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 ContentHandler
ContentHandler.setDocumentLocator(org.xml.sax.Locator)
public void characters(char[] c, int start, int len) throws SAXException
characters
in interface ContentHandler
c
- The characters from the XML document.start
- The start position in the array.len
- The number of characters to read from the array.SAXException
public void ignorableWhitespace(char[] c, int start, int len) throws SAXException
ignorableWhitespace
in interface ContentHandler
c
- The characters from the XML document.start
- The start position in the array.len
- The number of characters to read from the array.SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
target
- The processing instruction target.data
- The processing instruction data, or null if none was
supplied.SAXException
public void skippedEntity(String name) throws SAXException
skippedEntity
in interface ContentHandler
name
- The name of the skipped entity. If it is a parameter
entity, the name will begin with '%'.SAXException
public void startDTD(String name, String publicId, String systemId) throws SAXException
startDTD
in interface LexicalHandler
name
- 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.SAXException
public void endDTD() throws SAXException
endDTD
in interface LexicalHandler
SAXException
public void startEntity(String name) throws SAXException
startEntity
in interface LexicalHandler
name
- The name of the entity. If it is a parameter entity, the
name will begin with '%'.SAXException
public void endEntity(String name) throws SAXException
endEntity
in interface LexicalHandler
name
- The name of the entity that is ending.SAXException
public void startCDATA() throws SAXException
startCDATA
in interface LexicalHandler
SAXException
public void endCDATA() throws SAXException
endCDATA
in interface LexicalHandler
SAXException
public void comment(char[] ch, int start, int len) throws SAXException
comment
in interface LexicalHandler
ch
- 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.SAXException
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
SAXException
public void startPrefixMapping(String prefix, String uri) throws SAXException
xmlns:
attributes
in startElement()
.startPrefixMapping
in interface ContentHandler
SAXException
public 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 ContentHandler
SAXException
public void endElement(String eltUri, String eltLocalName, String eltQName) throws SAXException
endElement
in interface ContentHandler
SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
SAXException
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.