Package net.sf.saxon.option.axiom
Class AxiomDocument
java.lang.Object
net.sf.saxon.om.GenericTreeInfo
net.sf.saxon.option.axiom.AxiomDocument
- All Implemented Interfaces:
Source
,ActiveSource
,TreeInfo
Information about a tree that wraps an AXIOM document
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
protected static class
-
Field Summary
Fields inherited from class net.sf.saxon.om.GenericTreeInfo
root
-
Constructor Summary
ConstructorsConstructorDescriptionAxiomDocument
(org.apache.axiom.om.OMDocument root, String baseURI, Configuration config) Create a Saxon wrapper for an Axiom document node -
Method Summary
Modifier and TypeMethodDescriptionvoid
deliver
(Receiver receiver, ParseOptions options) Implement ActiveSource by delivering the document to a supplied receiverprotected static NodeInfo
makeWrapper
(org.apache.axiom.om.OMNode node, AxiomDocument docWrapper, AxiomParentNodeWrapper parent, int index) Factory method to wrap an Axiom node with a wrapper that implements the Saxon NodeInfo interface.Get the element with a given ID, if anywrap
(org.apache.axiom.om.OMNode node) Wrap a node in the Axiom document.Methods inherited from class net.sf.saxon.om.GenericTreeInfo
getConfiguration, getDocumentNumber, getDurability, getPublicId, getRootNode, getSpaceStrippingRule, getSystemId, getUnparsedEntity, getUnparsedEntityNames, getUserData, isMutable, isStreamed, setConfiguration, setDocumentNumber, setDurability, setRootNode, setSpaceStrippingRule, setSystemId, setUserData
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.xml.transform.Source
getSystemId, isEmpty, setSystemId
-
Constructor Details
-
AxiomDocument
Create a Saxon wrapper for an Axiom document node- Parameters:
root
- The Axiom root nodebaseURI
- The base URI for all the nodes in the treeconfig
- The configuration which defines the name pool used for all names in this tree
-
-
Method Details
-
deliver
Implement ActiveSource by delivering the document to a supplied receiver- Specified by:
deliver
in interfaceActiveSource
- Parameters:
receiver
- the receiver to which events representing the parsed XML document will be sentoptions
- options for parsing the source- Throws:
XPathException
- if things don't work out
-
wrap
Wrap a node in the Axiom document.- Parameters:
node
- The node to be wrapped. This must be a node in the same document (the system does not check for this).- Returns:
- the wrapping NodeInfo object
-
makeWrapper
protected static NodeInfo makeWrapper(org.apache.axiom.om.OMNode node, AxiomDocument docWrapper, AxiomParentNodeWrapper parent, int index) Factory method to wrap an Axiom node with a wrapper that implements the Saxon NodeInfo interface.- Parameters:
node
- The Axiom node (an element, text, processing-instruction, or comment node)docWrapper
- The wrapper for the Document containing this nodeparent
- The wrapper for the parent of the Axiom node. May be null if not known.index
- The position of this node relative to its siblings. May be -1 if not known- Returns:
- The new wrapper for the supplied node
-
selectID
Get the element with a given ID, if any- Specified by:
selectID
in interfaceTreeInfo
- Overrides:
selectID
in classGenericTreeInfo
- Parameters:
id
- the required ID valuegetParent
- true if the parent of the selected node is required (for element-with-id)- Returns:
- the element with the given ID, or null if there is no such ID present (or if the parser has not notified attributes as being of type ID).
-