Package net.sf.saxon.option.dom4j
Class DOM4JDocumentWrapper
- java.lang.Object
- 
- net.sf.saxon.om.GenericTreeInfo
- 
- net.sf.saxon.option.dom4j.DOM4JDocumentWrapper
 
 
- 
- All Implemented Interfaces:
- javax.xml.transform.Source,- TreeInfo
 
 public class DOM4JDocumentWrapper extends GenericTreeInfo TreeInfo class for a virtual tree that wraps a DOM4J tree
- 
- 
Field Summary- 
Fields inherited from class net.sf.saxon.om.GenericTreeInforoot
 
- 
 - 
Constructor SummaryConstructors Constructor Description DOM4JDocumentWrapper(org.dom4j.Document doc, java.lang.String baseURI, Configuration config)Create a Saxon wrapper for a dom4j document
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.dom4j.BranchsearchForParent(org.dom4j.Branch subtree, org.dom4j.Node node)DOM4J does not guarantee to provide the parent of a node, but XDM requires this.NodeInfoselectID(java.lang.String id, boolean getParent)Get the element with a given ID, if anyNodeInfowrap(org.dom4j.Node node)Wrap a node in the dom4j document.- 
Methods inherited from class net.sf.saxon.om.GenericTreeInfogetConfiguration, getDocumentNumber, getPublicId, getRootNode, getSpaceStrippingRule, getSystemId, getUnparsedEntity, getUnparsedEntityNames, getUserData, isStreamed, setConfiguration, setDocumentNumber, setRootNode, setSpaceStrippingRule, setSystemId, setUserData
 
- 
 
- 
- 
- 
Constructor Detail- 
DOM4JDocumentWrapperpublic DOM4JDocumentWrapper(org.dom4j.Document doc, java.lang.String baseURI, Configuration config)Create a Saxon wrapper for a dom4j document- Parameters:
- doc- The dom4j document
- baseURI- The base URI for all the nodes in the document
- config- The Saxon configuration
 
 
- 
 - 
Method Detail- 
wrappublic NodeInfo wrap(org.dom4j.Node node) Wrap a node in the dom4j 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
 
 - 
selectIDpublic NodeInfo selectID(java.lang.String id, boolean getParent) Get the element with a given ID, if any- Specified by:
- selectIDin interface- TreeInfo
- Overrides:
- selectIDin class- GenericTreeInfo
- Parameters:
- id- the required ID value
- getParent- true if the parent of the element having ID type is required
- Returns:
- null: dom4j does not provide any information about attribute types.
 
 - 
searchForParentpublic static org.dom4j.Branch searchForParent(org.dom4j.Branch subtree, org.dom4j.Node node)DOM4J does not guarantee to provide the parent of a node, but XDM requires this. In extremis, if we need the parent of a node and it is not known, we search the document looking for it. This is (fortunately!) very rarely necessary. One situation where we know it is needed is to find the parent of a processing instruction whose parent is in fact the document node.- Parameters:
- subtree- the root of a subtree to be searched
- node- a node to be sought within this subtree
- Returns:
- the parent of the sought node if it is found; otherwise null
 
 
- 
 
-