public class RecursiveXPathBuilder extends java.lang.Object implements Mapper<org.w3c.dom.Node,XPathContext>
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.String> |
prefix2uri |
Constructor and Description |
---|
RecursiveXPathBuilder() |
Modifier and Type | Method and 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.
|
public void setNamespaceContext(java.util.Map<java.lang.String,java.lang.String> prefix2uri)
Without a namespace context (or with an empty context) the XPath expressions will only use local names for elements and attributes.
prefix2uri
- maps from prefix to namespace URI.public XPathContext apply(org.w3c.dom.Node n)
apply
in interface Mapper<org.w3c.dom.Node,XPathContext>
private XPathContext getXPathForNonAttribute(org.w3c.dom.Node n)
private XPathContext getXPathForAttribute(org.w3c.dom.Attr a)