org.apache.xpath
public class CachedXPathAPI extends Object
See Also: XPath Specification
Constructor Summary | |
---|---|
CachedXPathAPI() Default constructor. | |
CachedXPathAPI(CachedXPathAPI priorXPathAPI) This constructor shares its {@link XPathContext} with a pre-existing {@link CachedXPathAPI}. |
Method Summary | |
---|---|
XObject | eval(Node contextNode, String str)
Evaluate XPath string to an XObject. |
XObject | eval(Node contextNode, String str, Node namespaceNode)
Evaluate XPath string to an XObject.
|
XObject | eval(Node contextNode, String str, PrefixResolver prefixResolver)
Evaluate XPath string to an XObject.
|
XPathContext | getXPathContext() Returns the XPathSupport object used in this CachedXPathAPI
%REVIEW% I'm somewhat concerned about the loss of encapsulation
this causes, but the xml-security folks say they need it.
|
NodeIterator | selectNodeIterator(Node contextNode, String str)
Use an XPath string to select a nodelist.
|
NodeIterator | selectNodeIterator(Node contextNode, String str, Node namespaceNode)
Use an XPath string to select a nodelist.
|
NodeList | selectNodeList(Node contextNode, String str)
Use an XPath string to select a nodelist.
|
NodeList | selectNodeList(Node contextNode, String str, Node namespaceNode)
Use an XPath string to select a nodelist.
|
Node | selectSingleNode(Node contextNode, String str)
Use an XPath string to select a single node. |
Node | selectSingleNode(Node contextNode, String str, Node namespaceNode)
Use an XPath string to select a single node.
|
Default constructor. Establishes its own {@link XPathContext}, and hence its own {@link org.apache.xml.dtm.DTMManager}. Good choice for simple uses.
Note that any particular instance of {@link CachedXPathAPI} must not be operated upon by multiple threads without synchronization; we do not currently support multithreaded access to a single {@link org.apache.xml.dtm.DTM}.
This constructor shares its {@link XPathContext} with a pre-existing {@link CachedXPathAPI}. That allows sharing document models ({@link org.apache.xml.dtm.DTM}) and previously established location state.
Note that the original {@link CachedXPathAPI} and the new one should not be operated upon concurrently; we do not support multithreaded access to a single {@link org.apache.xml.dtm.DTM} at this time. Similarly, any particular instance of {@link CachedXPathAPI} must not be operated upon by multiple threads without synchronization.
%REVIEW% Should this instead do a clone-and-reset on the XPathSupport object?
Parameters: contextNode The node to start searching from. str A valid XPath string.
Returns: An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null.
Throws: TransformerException
Parameters: contextNode The node to start searching from. str A valid XPath string. namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
Returns: An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null.
Throws: TransformerException
Parameters: contextNode The node to start searching from. str A valid XPath string. prefixResolver Will be called if the parser encounters namespace prefixes, to resolve the prefixes to URLs.
Returns: An XObject, which can be used to obtain a string, number, nodelist, etc, should never be null.
Throws: TransformerException
Parameters: contextNode The node to start searching from. str A valid XPath string.
Returns: A NodeIterator, should never be null.
Throws: TransformerException
Parameters: contextNode The node to start searching from. str A valid XPath string. namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
Returns: A NodeIterator, should never be null.
Throws: TransformerException
Parameters: contextNode The node to start searching from. str A valid XPath string.
Returns: A NodeIterator, should never be null.
Throws: TransformerException
Parameters: contextNode The node to start searching from. str A valid XPath string. namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
Returns: A NodeIterator, should never be null.
Throws: TransformerException
Parameters: contextNode The node to start searching from. str A valid XPath string.
Returns: The first node found that matches the XPath, or null.
Throws: TransformerException
Parameters: contextNode The node to start searching from. str A valid XPath string. namespaceNode The node from which prefixes in the XPath will be resolved to namespaces.
Returns: The first node found that matches the XPath, or null.
Throws: TransformerException