Class OMXMLReader

  • All Implemented Interfaces:
    XMLReader

    public class OMXMLReader
    extends org.apache.axiom.util.sax.AbstractXMLReader
    Deprecated.
    This class is used internally by 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).
    SAX 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.
    • Field Summary

      • Fields inherited from class org.apache.axiom.util.sax.AbstractXMLReader

        contentHandler, dtdHandler, entityResolver, errorHandler, externalGeneralEntities, lexicalHandler, namespacePrefixes, namespaces
    • Constructor Summary

      Constructors 
      Constructor Description
      OMXMLReader​(org.apache.axiom.om.OMContainer root)
      Deprecated.