OMSource. Starting with Axiom 1.2.13,
application code should use OMContainer.getSAXSource(boolean) to serialize an OM tree to
SAX. If there is a need to obtain an XMLReader instance, use
SAXSource.getXMLReader() on the SAXSource returned by
OMContainer.getSAXSource(boolean).public class OMXMLReader
extends org.apache.axiom.util.sax.AbstractXMLReader
XMLReader implementation that traverses a given OM tree and invokes the
callback methods on the configured ContentHandler. This can be used to
serialize an Axiom tree to SAX.
Note that this class only supports ContentHandler and LexicalHandler.
DTDHandler and DeclHandler 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 and
endPrefixMapping 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 the ns prefix, even if the serialization starts only at the child element.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
OMXMLReader.AttributesAdapter
Deprecated.
|
| Constructor and Description |
|---|
OMXMLReader(org.apache.axiom.om.OMContainer root)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
parse(InputSource input)
Deprecated.
|
void |
parse(String systemId)
Deprecated.
|
public void parse(InputSource input) throws IOException, SAXException
IOExceptionSAXExceptionpublic void parse(String systemId) throws IOException, SAXException
IOExceptionSAXExceptionCopyright © The Apache Software Foundation. All Rights Reserved.