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, toStringpublic ExpandedTitleContentHandler()
public ExpandedTitleContentHandler(org.xml.sax.ContentHandler handler)
public void startDocument()
throws org.xml.sax.SAXException
startDocument in interface org.xml.sax.ContentHandlerstartDocument in class ContentHandlerDecoratororg.xml.sax.SAXExceptionpublic 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.ContentHandlerstartElement in class ContentHandlerDecoratororg.xml.sax.SAXExceptionpublic 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.ContentHandlerendElement in class ContentHandlerDecoratororg.xml.sax.SAXExceptionpublic void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlercharacters in class ContentHandlerDecoratororg.xml.sax.SAXExceptionCopyright © 2010 - 2023 Adobe. All Rights Reserved