|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.xml.AbstractXMLProducer org.apache.cocoon.xml.AbstractXMLPipe org.apache.cocoon.serialization.AbstractTextSerializer.NamespaceAsAttributes
public static class AbstractTextSerializer.NamespaceAsAttributes
A pipe that ensures that all namespace prefixes are also present as 'xmlns:' attributes. This used to circumvent Xalan's serialization behaviour which is to ignore namespaces if they're not present as 'xmlns:xxx' attributes.
Field Summary |
---|
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Constructor Summary | |
---|---|
AbstractTextSerializer.NamespaceAsAttributes()
|
Method Summary | |
---|---|
void |
endDocument()
Receive notification of the end of a document. |
void |
endElement(String eltUri,
String eltLocalName,
String eltQName)
Receive notification of the end of an element. |
void |
endPrefixMapping(String prefix)
End the scope of a prefix-URI mapping: remove entry from mapping tables. |
void |
startDocument()
Receive notification of the beginning of a document. |
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 |
startPrefixMapping(String prefix,
String uri)
Track mappings to be able to add xmlns: attributes
in startElement() . |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
---|
characters, comment, endCDATA, endDTD, endEntity, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDTD, startEntity |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
recycle, setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
---|
setConsumer |
Constructor Detail |
---|
public AbstractTextSerializer.NamespaceAsAttributes()
Method Detail |
---|
public void startDocument() throws SAXException
AbstractXMLPipe
startDocument
in interface ContentHandler
startDocument
in class AbstractXMLPipe
SAXException
public void startPrefixMapping(String prefix, String uri) throws SAXException
xmlns:
attributes
in startElement()
.
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class AbstractXMLPipe
prefix
- The Namespace prefix being declared.uri
- The Namespace URI the prefix is mapped to.
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
startElement
in class AbstractXMLPipe
eltUri
- The Namespace URI, or the empty string if the element has no
Namespace URI or if Namespace
processing is not being performed.eltLocalName
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.eltQName
- The raw XML 1.0 name (with prefix), or the empty string if
raw names are not available.attrs
- The attributes attached to the element. If there are no
attributes, it shall be an empty Attributes object.
SAXException
public void endElement(String eltUri, String eltLocalName, String eltQName) throws SAXException
endElement
in interface ContentHandler
endElement
in class AbstractXMLPipe
eltUri
- The Namespace URI, or the empty string if the element has no
Namespace URI or if Namespace
processing is not being performed.eltLocalName
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.eltQName
- The raw XML 1.0 name (with prefix), or the empty string if
raw names are not available.
SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class AbstractXMLPipe
prefix
- The prefix that was being mapping.
SAXException
public void endDocument() throws SAXException
AbstractXMLPipe
endDocument
in interface ContentHandler
endDocument
in class AbstractXMLPipe
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |