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.
|
protected boolean |
isInvalid(int ch)
Checks whether the given Unicode character is an invalid XML character
and should be replaced for output.
|
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,
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, writeReplacementendPrefixMapping, handleException, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startPrefixMapping, toStringerror, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warningpublic static final String XHTML
public XHTMLContentHandler(ContentHandler handler, Metadata metadata)
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class ContentHandlerDecoratorSAXExceptionpublic void endDocument()
throws SAXException
</body> </html>
endDocument in interface ContentHandlerendDocument in class SafeContentHandlerSAXExceptionpublic void startElement(String uri, String local, String name, Attributes attributes) throws SAXException
startElement in interface ContentHandlerstartElement in class SafeContentHandlerSAXExceptionpublic void endElement(String uri, String local, String name) throws SAXException
endElement in interface ContentHandlerendElement in class SafeContentHandlerSAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class SafeContentHandlerSAXExceptionpublic void startElement(String name) throws SAXException
SAXExceptionpublic void startElement(String name, String attribute, String value) throws SAXException
SAXExceptionpublic void startElement(String name, AttributesImpl attributes) throws SAXException
SAXExceptionpublic void endElement(String name) throws SAXException
SAXExceptionpublic void characters(String characters) throws SAXException
SAXExceptionpublic void newline()
throws SAXException
SAXExceptionpublic void element(String name, String value) throws SAXException
name - XHTML element namevalue - element value, possibly nullSAXException - if the content element could not be writtenprotected boolean isInvalid(int ch)
SafeContentHandlerChar ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
isInvalid in class SafeContentHandlerch - charactertrue if the character should be replaced,
false otherwiseCopyright © 2007–2022 The Apache Software Foundation. All rights reserved.