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:
javax.xml.transform.Source,ActiveSource,TreeInfo
public class AxiomDocument extends GenericTreeInfo implements ActiveSource
Information about a tree that wraps an AXIOM document
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAxiomDocument.FollowingSiblingIteratorprotected static classAxiomDocument.PrecedingSiblingIterator
-
Field Summary
-
Fields inherited from class net.sf.saxon.om.GenericTreeInfo
root
-
-
Constructor Summary
Constructors Constructor Description AxiomDocument(org.apache.axiom.om.OMDocument root, java.lang.String baseURI, Configuration config)Create a Saxon wrapper for an Axiom document node
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeliver(Receiver receiver, ParseOptions options)Implement ActiveSource by delivering the document to a supplied receiverprotected static NodeInfomakeWrapper(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.NodeInfoselectID(java.lang.String id, boolean getParent)Get the element with a given ID, if anyNodeInfowrap(org.apache.axiom.om.OMNode node)Wrap a node in the Axiom document.-
Methods inherited from class net.sf.saxon.om.GenericTreeInfo
getConfiguration, getDocumentNumber, getPublicId, getRootNode, getSpaceStrippingRule, getSystemId, getUnparsedEntity, getUnparsedEntityNames, getUserData, isStreamed, setConfiguration, setDocumentNumber, setRootNode, setSpaceStrippingRule, setSystemId, setUserData
-
-
-
-
Constructor Detail
-
AxiomDocument
public AxiomDocument(org.apache.axiom.om.OMDocument root, java.lang.String baseURI, Configuration config)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 Detail
-
deliver
public void deliver(Receiver receiver, ParseOptions options) throws XPathException
Implement ActiveSource by delivering the document to a supplied receiver- Specified by:
deliverin 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
public NodeInfo wrap(org.apache.axiom.om.OMNode node)
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
public NodeInfo selectID(java.lang.String id, boolean getParent)
Get the element with a given ID, if any- Specified by:
selectIDin interfaceTreeInfo- Overrides:
selectIDin 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).
-
-