Package org.apache.tika.sax
Class ExpandedTitleContentHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.tika.sax.ContentHandlerDecorator
org.apache.tika.sax.ExpandedTitleContentHandler
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
Content handler decorator which wraps a
TransformerHandler
in order to
allow the TITLE
tag to render as <title></title>
rather than <title/>
which is accomplished
by calling the ContentHandler.characters(char[], int, int)
method
with a length
of 1 but a zero length char array.
This workaround is an unfortunate circumstance of the limitations imposed by the
implementation of the XML serialization code in the JDK brought over from
the xalan project which no longer allows for the specification of an
alternate content-handler
via xslt templates or other means.
- See Also:
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] ch, int start, int length) void
endElement
(String uri, String localName, String qName) void
void
startElement
(String uri, String localName, String qName, Attributes atts) Methods inherited from class org.apache.tika.sax.ContentHandlerDecorator
endDocument, endPrefixMapping, error, fatalError, handleException, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startPrefixMapping, toString, warning
Methods inherited from class org.xml.sax.helpers.DefaultHandler
notationDecl, resolveEntity, unparsedEntityDecl
-
Constructor Details
-
ExpandedTitleContentHandler
public ExpandedTitleContentHandler() -
ExpandedTitleContentHandler
-
-
Method Details
-
startDocument
- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classContentHandlerDecorator
- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classContentHandlerDecorator
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classContentHandlerDecorator
- Throws:
SAXException
-
characters
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classContentHandlerDecorator
- Throws:
SAXException
-