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(org.xml.sax.ContentHandler handler) |
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName) |
void |
startDocument() |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts) |
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, toString
public ExpandedTitleContentHandler()
public ExpandedTitleContentHandler(org.xml.sax.ContentHandler handler)
public void startDocument() throws org.xml.sax.SAXException
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class ContentHandlerDecorator
org.xml.sax.SAXException
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class ContentHandlerDecorator
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class ContentHandlerDecorator
org.xml.sax.SAXException
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class ContentHandlerDecorator
org.xml.sax.SAXException
Copyright © 2010 - 2020 Adobe. All Rights Reserved