public class XHTMLContentHandler extends SafeContentHandler
SafeContentHandler.Output
Modifier and Type | Field and Description |
---|---|
static Set<String> |
ENDLINE
The elements that get appended with the
NL character. |
static String |
XHTML
The XHTML namespace URI
|
Constructor and Description |
---|
XHTMLContentHandler(ContentHandler handler,
Metadata metadata) |
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
characters(String characters) |
void |
element(String name,
String value)
Emits an XHTML element with the given text content.
|
void |
endDocument()
Ends the XHTML document by writing the following footer and
clearing the namespace mappings:
|
void |
endElement(String name) |
void |
endElement(String uri,
String local,
String name)
Ends the given element.
|
void |
newline() |
void |
startDocument()
Starts an XHTML document by setting up the namespace mappings
when called for the first time.
|
void |
startElement(String name) |
void |
startElement(String name,
org.xml.sax.helpers.AttributesImpl attributes) |
void |
startElement(String name,
String attribute,
String value) |
void |
startElement(String uri,
String local,
String name,
Attributes attributes)
Starts the given element.
|
ignorableWhitespace, isInvalid, writeReplacement
endPrefixMapping, handleException, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startPrefixMapping, toString
error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warning
public static final String XHTML
public XHTMLContentHandler(ContentHandler handler, Metadata metadata)
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class ContentHandlerDecorator
SAXException
public void endDocument() throws SAXException
</body> </html>
endDocument
in interface ContentHandler
endDocument
in class SafeContentHandler
SAXException
public void startElement(String uri, String local, String name, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class SafeContentHandler
SAXException
public void endElement(String uri, String local, String name) throws SAXException
endElement
in interface ContentHandler
endElement
in class SafeContentHandler
SAXException
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class SafeContentHandler
SAXException
public void startElement(String name) throws SAXException
SAXException
public void startElement(String name, String attribute, String value) throws SAXException
SAXException
public void startElement(String name, org.xml.sax.helpers.AttributesImpl attributes) throws SAXException
SAXException
public void endElement(String name) throws SAXException
SAXException
public void characters(String characters) throws SAXException
SAXException
public void newline() throws SAXException
SAXException
public void element(String name, String value) throws SAXException
name
- XHTML element namevalue
- element value, possibly null
SAXException
- if the content element could not be writtenCopyright © 2007–2016 The Apache Software Foundation. All rights reserved.