public class JAXPXPathEngine extends java.lang.Object implements XPathEngine
Modifier and Type | Field and Description |
---|---|
private javax.xml.xpath.XPath |
xpath |
Constructor and Description |
---|
JAXPXPathEngine()
Create an XPathEngine that uses JAXP's default XPathFactory
under the covers.
|
JAXPXPathEngine(javax.xml.xpath.XPathFactory fac) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
evaluate(java.lang.String xPath,
org.w3c.dom.Node n)
Evaluates an XPath expression and stringifies the result.
|
java.lang.String |
evaluate(java.lang.String xPath,
javax.xml.transform.Source s)
Evaluates an XPath expression and stringifies the result.
|
java.lang.Iterable<org.w3c.dom.Node> |
selectNodes(java.lang.String xPath,
org.w3c.dom.Node n)
Returns a potentially empty collection of Nodes matching an
XPath expression.
|
java.lang.Iterable<org.w3c.dom.Node> |
selectNodes(java.lang.String xPath,
javax.xml.transform.Source s)
Returns a potentially empty collection of Nodes matching an
XPath expression.
|
void |
setNamespaceContext(java.util.Map<java.lang.String,java.lang.String> prefix2Uri)
Establish a namespace context.
|
public JAXPXPathEngine(javax.xml.xpath.XPathFactory fac)
public JAXPXPathEngine()
public java.lang.Iterable<org.w3c.dom.Node> selectNodes(java.lang.String xPath, javax.xml.transform.Source s)
selectNodes
in interface XPathEngine
public java.lang.String evaluate(java.lang.String xPath, javax.xml.transform.Source s)
evaluate
in interface XPathEngine
public java.lang.Iterable<org.w3c.dom.Node> selectNodes(java.lang.String xPath, org.w3c.dom.Node n)
selectNodes
in interface XPathEngine
public java.lang.String evaluate(java.lang.String xPath, org.w3c.dom.Node n)
evaluate
in interface XPathEngine
public void setNamespaceContext(java.util.Map<java.lang.String,java.lang.String> prefix2Uri)
setNamespaceContext
in interface XPathEngine
prefix2Uri
- maps from prefix to namespace URI.