@Test public void rootElement() throws Exception { Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder() .newDocument(); assertEquals("/foo[1]", new XPathContext(doc.createElement("foo")) .getXPath()); }
public String getXPath() { return getXPath(path.descendingIterator()); }
XPathContext implements Cloneable { public String getXPath() { return getXPath(path.descendingIterator()); } }
XPathContext implements Cloneable { public String getXPath() { return getXPath(path.descendingIterator()); } XPathContext();  XPathContext(Node root);  XPathContext(Map<String, String> prefix2uri);  XPathContext(Map<String, String> prefix2uri, Node root); }
XPathContext implements Cloneable { public String getXPath() { return getXPath(path.descendingIterator()); } XPathContext();  XPathContext(Node root);  XPathContext(Map<String, String> prefix2uri);  XPathContext(Map<String, String> prefix2uri, Node root); void navigateToChild(int index); void navigateToAttribute(QName attribute); void navigateToParent(); void addAttributes(Iterable<? extends QName> attributes); void addAttribute(QName attribute); void setChildren(Iterable<? extends NodeInfo> children); void appendChildren(Iterable<? extends NodeInfo> children); String getXPath(); String getParentXPath(); @Override XPathContext clone(); }
XPathContext implements Cloneable { public String getXPath() { return getXPath(path.descendingIterator()); } XPathContext();  XPathContext(Node root);  XPathContext(Map<String, String> prefix2uri);  XPathContext(Map<String, String> prefix2uri, Node root); void navigateToChild(int index); void navigateToAttribute(QName attribute); void navigateToParent(); void addAttributes(Iterable<? extends QName> attributes); void addAttribute(QName attribute); void setChildren(Iterable<? extends NodeInfo> children); void appendChildren(Iterable<? extends NodeInfo> children); String getXPath(); String getParentXPath(); @Override XPathContext clone();  }