Java XML Node Local Name getLocalName(Node el)

Here you can find the source of getLocalName(Node el)

Description

get the name of an XML element, with the namespace prefix stripped off

License

Open Source License

Parameter

Parameter Description
el a parameter

Declaration

public static String getLocalName(Node el) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.StringTokenizer;

import org.w3c.dom.Node;

public class Main {
    /**/*ww  w.j a  v a2s  .com*/
     * get the name of an XML element, with the namespace prefix stripped off
     * @param el
     * @return
     */
    public static String getLocalName(Node el) {
        String locName = "";
        StringTokenizer st = new StringTokenizer(el.getNodeName(), ":");
        while (st.hasMoreTokens())
            locName = st.nextToken();
        return locName;
    }
}

Related

  1. getElementByTagNameNS(Node node, String namespaceURI, String localName)
  2. getLocalName(final Node n)
  3. getLocalName(final Node node)
  4. getLocalName(Node element)
  5. getLocalName(Node node)
  6. getLocalName(Node node)
  7. getLocalName(Node node)