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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] characters, int start, int length) voidendElement(String uri, String localName, String qName) protected booleanisSafeHtmlElement(String localName) voidstartElement(String uri, String localName, String qName, Attributes attributes) protected voidMethods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
XmlToHtmlConverter
protected XmlToHtmlConverter()
-
-
Method Details
-
write
- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin 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
-