public class ExpandedTitleContentHandler extends ContentHandlerDecorator
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.
| Constructor and Description |
|---|
ExpandedTitleContentHandler() |
ExpandedTitleContentHandler(ContentHandler handler) |
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
endElement(String uri,
String localName,
String qName) |
void |
startDocument() |
void |
startElement(String uri,
String localName,
String qName,
Attributes atts) |
endDocument, endPrefixMapping, handleException, ignorableWhitespace, processingInstruction, setContentHandler, setDocumentLocator, skippedEntity, startPrefixMapping, toStringerror, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warningpublic ExpandedTitleContentHandler()
public ExpandedTitleContentHandler(ContentHandler handler)
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class ContentHandlerDecoratorSAXExceptionpublic void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
startElement in interface ContentHandlerstartElement in class ContentHandlerDecoratorSAXExceptionpublic void endElement(String uri, String localName, String qName) throws SAXException
endElement in interface ContentHandlerendElement in class ContentHandlerDecoratorSAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class ContentHandlerDecoratorSAXExceptionCopyright © 2007–2023 The Apache Software Foundation. All rights reserved.