Package org.xmlunit.diff
Class RecursiveXPathBuilder
- java.lang.Object
-
- org.xmlunit.diff.RecursiveXPathBuilder
-
- All Implemented Interfaces:
Mapper<org.w3c.dom.Node,XPathContext>
public class RecursiveXPathBuilder extends java.lang.Object implements Mapper<org.w3c.dom.Node,XPathContext>
Finds the XPathContext of a Node by recursively building up the XPathContext.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>
prefix2uri
-
Constructor Summary
Constructors Constructor Description RecursiveXPathBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XPathContext
apply(org.w3c.dom.Node n)
private XPathContext
getXPathForAttribute(org.w3c.dom.Attr a)
private XPathContext
getXPathForNonAttribute(org.w3c.dom.Node n)
void
setNamespaceContext(java.util.Map<java.lang.String,java.lang.String> prefix2uri)
Establish a namespace context that will be used in for the XPath.
-
-
-
Method Detail
-
setNamespaceContext
public void setNamespaceContext(java.util.Map<java.lang.String,java.lang.String> prefix2uri)
Establish a namespace context that will be used in for the XPath.Without a namespace context (or with an empty context) the XPath expressions will only use local names for elements and attributes.
- Parameters:
prefix2uri
- maps from prefix to namespace URI.
-
apply
public XPathContext apply(org.w3c.dom.Node n)
- Specified by:
apply
in interfaceMapper<org.w3c.dom.Node,XPathContext>
-
getXPathForNonAttribute
private XPathContext getXPathForNonAttribute(org.w3c.dom.Node n)
-
getXPathForAttribute
private XPathContext getXPathForAttribute(org.w3c.dom.Attr a)
-
-