Java XML Node Name getName(Node node)

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

Description

Gets the local (sans namespace) name of the given node.

License

Open Source License

Declaration

public static String getName(Node node) 

Method Source Code

//package com.java2s;

import org.w3c.dom.*;

public class Main {
    /** Gets the local (sans namespace) name of the given node. */
    public static String getName(Node node) {
        // NB: The node.getLocalName() method does not work.
        String name = node.getNodeName();
        int colon = name.lastIndexOf(":");
        return colon < 0 ? name : name.substring(colon + 1);
    }//from w  ww  .j a  v a  2 s .com
}

Related

  1. getBeanElement(Node elem, String nodeName)
  2. getDescendent(Node node, String nodeName)
  3. getIntegerNodeValue(Node node, String nodeName)
  4. getName(Node node)
  5. getName(Node node)
  6. getNode(final Node iNode, final String iNodeName)
  7. getNode(Node iNode, String iNodeName)
  8. getNode(Node iNode, String iNodeName)
  9. getNode(Node node, String nodeName)