public class JAXPXPathEngine extends Object implements XPathEngine
| Constructor and Description |
|---|
JAXPXPathEngine()
Create an XPathEngine that uses JAXP's default XPathFactory with
XPathFactoryConfigurer.Default applied
under the covers. |
JAXPXPathEngine(XPathFactory fac)
Create an XPathEngine that uses a custom XPathFactory.
|
| Modifier and Type | Method and Description |
|---|---|
String |
evaluate(String xPath,
Node n)
Evaluates an XPath expression and stringifies the result.
|
String |
evaluate(String xPath,
Source s)
Evaluates an XPath expression and stringifies the result.
|
Iterable<Node> |
selectNodes(String xPath,
Node n)
Returns a potentially empty collection of Nodes matching an
XPath expression.
|
Iterable<Node> |
selectNodes(String xPath,
Source s)
Returns a potentially empty collection of Nodes matching an
XPath expression.
|
void |
setNamespaceContext(Map<String,String> prefix2Uri)
Establish a namespace context.
|
public JAXPXPathEngine(XPathFactory fac)
fac - the factory to usepublic JAXPXPathEngine()
XPathFactoryConfigurer.Default applied
under the covers.public Iterable<Node> selectNodes(String xPath, Source s)
selectNodes in interface XPathEnginexPath - the XPath expressions - the XML source to apply the expression topublic String evaluate(String xPath, Source s)
evaluate in interface XPathEnginexPath - the XPath expressions - the XML source to apply the expression topublic Iterable<Node> selectNodes(String xPath, Node n)
selectNodes in interface XPathEnginexPath - the XPath expressionn - the XML source to apply the expression topublic String evaluate(String xPath, Node n)
evaluate in interface XPathEnginexPath - the XPath expressionn - the XML source to apply the expression topublic void setNamespaceContext(Map<String,String> prefix2Uri)
setNamespaceContext in interface XPathEngineprefix2Uri - maps from prefix to namespace URI.Copyright © 2001–2025 XMLUnit. All rights reserved.