Class OMXMLReader
- java.lang.Object
-
- org.apache.axiom.util.sax.AbstractXMLReader
-
- org.apache.axiom.om.impl.serialize.OMXMLReader
-
- All Implemented Interfaces:
XMLReader
public class OMXMLReader extends org.apache.axiom.util.sax.AbstractXMLReader
Deprecated.This class is used internally byOMSource
. Starting with Axiom 1.2.13, application code should useOMContainer.getSAXSource(boolean)
to serialize an OM tree to SAX. If there is a need to obtain anXMLReader
instance, useSAXSource.getXMLReader()
on theSAXSource
returned byOMContainer.getSAXSource(boolean)
.SAXXMLReader
implementation that traverses a given OM tree and invokes the callback methods on the configuredContentHandler
. This can be used to serialize an Axiom tree to SAX.Note that this class only supports
ContentHandler
andLexicalHandler
.DTDHandler
andDeclHandler
are not supported.This class can also generate SAX events for a subtree. This is the case if the element passed to the constructor is not the root element of the document. In this case, care is taken to properly generate
startPrefixMapping
andendPrefixMapping
events also for namespace mappings declared on the ancestors of the element.To understand why this is important, consider the following example:
<root xmlns:ns="urn:ns"><element attr="ns:someThing"/><root>
In that case, to correctly interpret the attribute value, the SAX content handler must be aware of the namespace mapping for thens
prefix, even if the serialization starts only at the child element.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
OMXMLReader.AttributesAdapter
Deprecated.
-
Constructor Summary
Constructors Constructor Description OMXMLReader(org.apache.axiom.om.OMContainer root)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
parse(String systemId)
Deprecated.void
parse(InputSource input)
Deprecated.
-
-
-
Method Detail
-
parse
public void parse(InputSource input) throws IOException, SAXException
Deprecated.- Throws:
IOException
SAXException
-
parse
public void parse(String systemId) throws IOException, SAXException
Deprecated.- Throws:
IOException
SAXException
-
-