Class DOMStreamer.NamespaceNormalizingDOMStreamer
- Enclosing class:
DOMStreamer
The code in this class is based on the org.apache.xml.utils.TreeWalker class from Xalan, though it differs in some important ways.
This class will automatically fix up ("normalize") namespace declarations while streaming to SAX. The original DOM-tree is not modified. The algorithm used is described in an appendix of the DOM Level 3 spec.
This class will NOT check the correctness of namespaces, e.g. it will not check that the "xml" prefix is not misused etc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Deprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetNamespaceForPrefix
(String prefix, Element namespaceContext) Deprecated.Searches the namespace for a given namespace prefix starting from a given Element.void
recycle()
Deprecated.Recycle the producer by removing references, and resetting handlers to null (empty) implementations.Methods inherited from class org.apache.cocoon.xml.sax.AbstractSAXProducer
setContentHandler
-
Constructor Details
-
NamespaceNormalizingDOMStreamer
public NamespaceNormalizingDOMStreamer()Deprecated.
-
-
Method Details
-
recycle
public void recycle()Deprecated.Description copied from class:AbstractSAXProducer
Recycle the producer by removing references, and resetting handlers to null (empty) implementations.- Overrides:
recycle
in classAbstractSAXProducer
-
getNamespaceForPrefix
Deprecated.Searches the namespace for a given namespace prefix starting from a given Element.Note that this resolves the prefix in the orginal DOM-tree, not in the
DOMStreamer.NamespaceNormalizingDOMStreamer.ElementInfo
objects. This is used to resolve prefixes of elements or attributes created with createElement or setAttribute instead of createElementNS or setAttributeNS.The code in this method is largely based on org.apache.xml.utils.DOMHelper.getNamespaceForPrefix() (from Xalan).
- Parameters:
prefix
- the prefix to look for, can be empty or null to find the default namespace- Returns:
- the namespace, or null if not found.
-