Java XPath Create getXPath(Node node)

Here you can find the source of getXPath(Node node)

Description

get X Path

License

Apache License

Declaration

public static String getXPath(Node node) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import org.w3c.dom.Node;

public class Main {
    public static String getXPath(Node node) {
        Node parent = node.getParentNode();
        if (parent == null) {
            return "";
        }// ww  w.  j  av a 2s. co m
        return getXPath(parent) + "/" + node.getLocalName();
    }
}

Related

  1. getXPath(Node n)
  2. getXPath(Node n)
  3. getXPath(Node n)
  4. getXPath(Node node)
  5. getXPath(Node node)
  6. getXPath(Node node, String xpath)
  7. getXPath(String exp, NamespaceContext ctx)
  8. getXPath(String expression)
  9. getXPathExpression(final Node node)