Package org.custommonkey.xmlunit.jaxp13
Class Jaxp13XpathEngine
- java.lang.Object
-
- org.custommonkey.xmlunit.jaxp13.Jaxp13XpathEngine
-
- All Implemented Interfaces:
XpathEngine
public class Jaxp13XpathEngine extends Object implements XpathEngine
XPath engine based on javax.xml.xpath.
-
-
Constructor Summary
Constructors Constructor Description Jaxp13XpathEngine()Creates a Jaxp13XpathEngine.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringevaluate(String select, Document document)Evaluate the result of executing the specified xpath syntaxselectexpression on the specified documentNodeListgetMatchingNodes(String select, Document document)Execute the specified xpath syntaxselectexpression on the specified document and return the list of nodes (could have length zero) that matchvoidsetNamespaceContext(NamespaceContext ctx)Establish a namespace context.
-
-
-
Constructor Detail
-
Jaxp13XpathEngine
public Jaxp13XpathEngine() throws ConfigurationExceptionCreates a Jaxp13XpathEngine.- Throws:
ConfigurationException- if the underlying implementation does
-
-
Method Detail
-
getMatchingNodes
public NodeList getMatchingNodes(String select, Document document) throws XpathException
Execute the specified xpath syntaxselectexpression on the specified document and return the list of nodes (could have length zero) that match- Specified by:
getMatchingNodesin interfaceXpathEngine- Parameters:
select- the XPath expressiondocument- the XML source to apply the expression to- Returns:
- matching nodes
- Throws:
XpathException- if the underlying implementation does
-
evaluate
public String evaluate(String select, Document document) throws XpathException
Evaluate the result of executing the specified xpath syntaxselectexpression on the specified document- Specified by:
evaluatein interfaceXpathEngine- Parameters:
select- the XPath expressiondocument- the XML source to apply the expression to- Returns:
- evaluated result
- Throws:
XpathException- if the underlying implementation does
-
setNamespaceContext
public void setNamespaceContext(NamespaceContext ctx)
Description copied from interface:XpathEngineEstablish a namespace context.- Specified by:
setNamespaceContextin interfaceXpathEngine- Parameters:
ctx- the NamespaceContext
-
-