org.apache.tika.sax
Class XHTMLContentHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.tika.sax.ContentHandlerDecorator
org.apache.tika.sax.SafeContentHandler
org.apache.tika.sax.XHTMLContentHandler
- All Implemented Interfaces:
- org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
public class XHTMLContentHandler
- extends SafeContentHandler
Content handler decorator that simplifies the task of producing XHTML
events for Tika content parsers.
Field Summary |
static java.lang.String |
XHTML
The XHTML namespace URI |
Method Summary |
void |
characters(char[] ch,
int start,
int length)
|
void |
characters(java.lang.String characters)
|
void |
element(java.lang.String name,
java.lang.String value)
|
void |
endDocument()
Ends the XHTML document by writing the following footer and
clearing the namespace mappings: |
void |
endElement(java.lang.String name)
|
void |
endElement(java.lang.String uri,
java.lang.String local,
java.lang.String name)
Ends the given element. |
void |
startDocument()
Starts an XHTML document by setting up the namespace mappings. |
void |
startElement(java.lang.String name)
|
void |
startElement(java.lang.String name,
java.lang.String attribute,
java.lang.String value)
|
void |
startElement(java.lang.String uri,
java.lang.String local,
java.lang.String name,
org.xml.sax.Attributes attributes)
Starts the given element. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
XHTML
public static final java.lang.String XHTML
- The XHTML namespace URI
- See Also:
- Constant Field Values
XHTMLContentHandler
public XHTMLContentHandler(org.xml.sax.ContentHandler handler,
Metadata metadata)
startDocument
public void startDocument()
throws org.xml.sax.SAXException
- Starts an XHTML document by setting up the namespace mappings.
The standard XHTML prefix is generated lazily when the first
element is started.
- Specified by:
startDocument
in interface org.xml.sax.ContentHandler
- Overrides:
startDocument
in class ContentHandlerDecorator
- Throws:
org.xml.sax.SAXException
endDocument
public void endDocument()
throws org.xml.sax.SAXException
- Ends the XHTML document by writing the following footer and
clearing the namespace mappings:
</body>
</html>
- Specified by:
endDocument
in interface org.xml.sax.ContentHandler
- Overrides:
endDocument
in class ContentHandlerDecorator
- Throws:
org.xml.sax.SAXException
startElement
public void startElement(java.lang.String uri,
java.lang.String local,
java.lang.String name,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
- Starts the given element. Table cells and list items are automatically
indented by emitting a tab character as ignorable whitespace.
- Specified by:
startElement
in interface org.xml.sax.ContentHandler
- Overrides:
startElement
in class ContentHandlerDecorator
- Throws:
org.xml.sax.SAXException
endElement
public void endElement(java.lang.String uri,
java.lang.String local,
java.lang.String name)
throws org.xml.sax.SAXException
- Ends the given element. Block elements are automatically followed
by a newline character.
- Specified by:
endElement
in interface org.xml.sax.ContentHandler
- Overrides:
endElement
in class ContentHandlerDecorator
- Throws:
org.xml.sax.SAXException
characters
public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
- Specified by:
characters
in interface org.xml.sax.ContentHandler
- Overrides:
characters
in class SafeContentHandler
- Throws:
org.xml.sax.SAXException
- See Also:
- TIKA-210
startElement
public void startElement(java.lang.String name)
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
startElement
public void startElement(java.lang.String name,
java.lang.String attribute,
java.lang.String value)
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
endElement
public void endElement(java.lang.String name)
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
characters
public void characters(java.lang.String characters)
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
element
public void element(java.lang.String name,
java.lang.String value)
throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
Copyright © 2010 The Apache Software Foundation. All Rights Reserved.