@Test public void rootElement() { Element e = doc.createElement("foo"); doc.appendChild(e); assertEquals("/foo[1]", builder.apply(e).getXPath()); }
@Override public XPathContext apply(Node n) { if (n instanceof Attr) { return getXPathForAttribute((Attr) n); } else { return getXPathForNonAttribute(n); } }
RecursiveXPathBuilder implements Mapper<Node, XPathContext> { @Override public XPathContext apply(Node n) { if (n instanceof Attr) { return getXPathForAttribute((Attr) n); } else { return getXPathForNonAttribute(n); } } }
RecursiveXPathBuilder implements Mapper<Node, XPathContext> { @Override public XPathContext apply(Node n) { if (n instanceof Attr) { return getXPathForAttribute((Attr) n); } else { return getXPathForNonAttribute(n); } }  }
RecursiveXPathBuilder implements Mapper<Node, XPathContext> { @Override public XPathContext apply(Node n) { if (n instanceof Attr) { return getXPathForAttribute((Attr) n); } else { return getXPathForNonAttribute(n); } }  void setNamespaceContext(Map<String, String> prefix2uri); @Override XPathContext apply(Node n); }
RecursiveXPathBuilder implements Mapper<Node, XPathContext> { @Override public XPathContext apply(Node n) { if (n instanceof Attr) { return getXPathForAttribute((Attr) n); } else { return getXPathForNonAttribute(n); } }  void setNamespaceContext(Map<String, String> prefix2uri); @Override XPathContext apply(Node n);  }