|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
file2xliff4j.HtmlHandler
public class HtmlHandler
Class HtmlHandler uses HotSAX to read and parse HTML documents as if they were well-formed XML documents using a SAX-like API.
Constructor Summary | |
---|---|
HtmlHandler()
For testing only |
|
HtmlHandler(java.util.Set<java.lang.String> tuTags,
java.io.OutputStreamWriter outXliff,
java.io.OutputStreamWriter outSkeleton,
java.io.OutputStreamWriter outFormat,
java.util.Locale sourceLang,
java.lang.String docType,
java.lang.String originalFileName,
SegmentBoundary boundary)
This constructor sets up the HtmlHandler to be notified as each tag (etc.) is encountered in the HTML input stream. |
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
Called whenever characters are encountered |
void |
endDocument()
When the end-of-document is encountered, save the "candidate epilog" (the characters that follow the final TU), etc. |
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qualifiedName)
Method called whenever an end element is encountered |
void |
setDocumentLocator(org.xml.sax.Locator locator)
Method (inherited from Default Handler or one if its ancestors) that sets the "locator"--in this case the org.xml.sax.helpers.LocatorImpl class--which has methods that (among other things) return the current line and column numbers in the stream being parsed. |
void |
startDocument()
Method called by SAX parser at the beginning of document parsing. |
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qualifiedName,
org.xml.sax.Attributes atts)
Method called whenever a start element is encountered |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HtmlHandler()
public HtmlHandler(java.util.Set<java.lang.String> tuTags, java.io.OutputStreamWriter outXliff, java.io.OutputStreamWriter outSkeleton, java.io.OutputStreamWriter outFormat, java.util.Locale sourceLang, java.lang.String docType, java.lang.String originalFileName, SegmentBoundary boundary)
tuTags
- The set of HTML tags that signal a TU break.outXliff
- Where to write the XLIFFoutSkeleton
- Where to write the targetoutFormat
- Where to write the formatsourceLang
- The language of this originaldocType
- What kind of document is this (Probably HTML)originalFileName
- The original file's name (required as an attribute
in the "file" element)Method Detail |
---|
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface org.xml.sax.ContentHandler
setDocumentLocator
in class org.xml.sax.helpers.DefaultHandler
locator
- A reference to the locator implementation classpublic void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qualifiedName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
namespaceURI
- The URI of the namespacelocalName
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.qualifiedName
- The qualified name (with prefix), or the empty string
if qualified names are not availableatts
- The specified or defaulted attributes.
org.xml.sax.SAXException
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qualifiedName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
namespaceURI
- The URI of the namespacelocalName
- The local name (without prefix), or the empty string if Namespace processing is not being performed.qualifiedName
- The qualified name (with prefix), or the empty string if qualified names are not available
org.xml.sax.SAXException
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
ch
- Array containing characters encounteredstart
- Position in array of first applicable characterlength
- How many characters are of interest?
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |