Class XmlToHtmlConverter
java.lang.Object
org.xml.sax.helpers.DefaultHandler
chemaxon.naming.document.annotate.XmlToHtmlConverter
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
This class implements the default conversion from XML to HTML.
Methods defined in the org.xml.sax.ContentHandler interface are called as the XML is parsed. Each of them can be overridden to change the HTML output.
The write(String)
method can be used to write the HTML output.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] characters, int start, int length) void
endElement
(String uri, String localName, String qName) protected boolean
isSafeHtmlElement
(String localName) void
startElement
(String uri, String localName, String qName, Attributes attributes) protected void
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
XmlToHtmlConverter
protected XmlToHtmlConverter()
-
-
Method Details
-
write
- Throws:
SAXException
-
characters
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Throws:
SAXException
-
isSafeHtmlElement
- Parameters:
localName
- a tag name- Returns:
- true if and only if the tag should be left as-is in the HTML, instead of converted to the span element.
-
preprocess
- Throws:
IOException
-