public static class AbstractTraxSerializerFactory.NamespaceAsAttributes extends Object implements ContentHandler, LexicalHandler
| Modifier and Type | Field and Description |
|---|---|
protected ContentHandler |
contentHandler |
protected LexicalHandler |
lexicalHandler |
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
NamespaceAsAttributes(ContentHandler handler,
org.slf4j.Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] c,
int start,
int len)
Receive notification of character data.
|
void |
comment(char[] ch,
int start,
int len)
Report an XML comment anywhere in the document.
|
void |
endCDATA()
Report the end of a CDATA section.
|
void |
endDocument() |
void |
endDTD()
Report the end of DTD declarations.
|
void |
endElement(String eltUri,
String eltLocalName,
String eltQName)
Receive notification of the end of an element.
|
void |
endEntity(String name)
Report the end of an entity.
|
void |
endPrefixMapping(String prefix)
End the scope of a prefix-URI mapping:
remove entry from mapping tables.
|
void |
ignorableWhitespace(char[] c,
int start,
int len)
Receive notification of ignorable whitespace in element content.
|
void |
processingInstruction(String target,
String data)
Receive notification of a processing instruction.
|
void |
setDocumentLocator(Locator locator) |
void |
skippedEntity(String name)
Receive notification of a skipped entity.
|
void |
startCDATA()
Report the start of a CDATA section.
|
void |
startDocument() |
void |
startDTD(String name,
String publicId,
String systemId)
Report the start of DTD declarations, if any.
|
void |
startElement(String eltUri,
String eltLocalName,
String eltQName,
Attributes attrs)
Ensure all namespace declarations are present as
xmlns: attributes
and add those needed before calling superclass. |
void |
startEntity(String name)
Report the beginning of an entity.
|
void |
startPrefixMapping(String prefix,
String uri)
Track mappings to be able to add
xmlns: attributes
in startElement(). |
protected final ContentHandler contentHandler
protected final LexicalHandler lexicalHandler
protected final org.slf4j.Logger logger
public NamespaceAsAttributes(ContentHandler handler, org.slf4j.Logger logger)
public void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlerContentHandler.setDocumentLocator(org.xml.sax.Locator)public void characters(char[] c,
int start,
int len)
throws SAXException
characters in interface ContentHandlerc - The characters from the XML document.start - The start position in the array.len - The number of characters to read from the array.SAXExceptionpublic void ignorableWhitespace(char[] c,
int start,
int len)
throws SAXException
ignorableWhitespace in interface ContentHandlerc - The characters from the XML document.start - The start position in the array.len - The number of characters to read from the array.SAXExceptionpublic void processingInstruction(String target, String data) throws SAXException
processingInstruction in interface ContentHandlertarget - The processing instruction target.data - The processing instruction data, or null if none was
supplied.SAXExceptionpublic void skippedEntity(String name) throws SAXException
skippedEntity in interface ContentHandlername - The name of the skipped entity. If it is a parameter
entity, the name will begin with '%'.SAXExceptionpublic void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD in interface LexicalHandlername - The document type name.publicId - The declared public identifier for the external DTD
subset, or null if none was declared.systemId - The declared system identifier for the external DTD
subset, or null if none was declared.SAXExceptionpublic void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXExceptionpublic void startEntity(String name) throws SAXException
startEntity in interface LexicalHandlername - The name of the entity. If it is a parameter entity, the
name will begin with '%'.SAXExceptionpublic void endEntity(String name) throws SAXException
endEntity in interface LexicalHandlername - The name of the entity that is ending.SAXExceptionpublic void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXExceptionpublic void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXExceptionpublic void comment(char[] ch,
int start,
int len)
throws SAXException
comment in interface LexicalHandlerch - An array holding the characters in the comment.start - The starting position in the array.len - The number of characters to use from the array.SAXExceptionpublic void startDocument()
throws SAXException
startDocument in interface ContentHandlerSAXExceptionpublic void startPrefixMapping(String prefix, String uri) throws SAXException
xmlns: attributes
in startElement().startPrefixMapping in interface ContentHandlerSAXExceptionpublic void startElement(String eltUri, String eltLocalName, String eltQName, Attributes attrs) throws SAXException
xmlns: attributes
and add those needed before calling superclass. This is a workaround for a Xalan bug
(at least in version 2.0.1) : org.apache.xalan.serialize.SerializerToXML
ignores start/endPrefixMapping().startElement in interface ContentHandlerSAXExceptionpublic void endElement(String eltUri, String eltLocalName, String eltQName) throws SAXException
endElement in interface ContentHandlerSAXExceptionpublic void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping in interface ContentHandlerSAXExceptionpublic void endDocument()
throws SAXException
endDocument in interface ContentHandlerSAXExceptionCopyright © 2007–2017 The Apache Software Foundation. All rights reserved.