Java XML Node Text Value getTagValueWithoutNamespace(Node n)

Here you can find the source of getTagValueWithoutNamespace(Node n)

Description

Gets the tag value without namespace.

License

Open Source License

Parameter

Parameter Description
n the n

Return

the tag value without namespace

Declaration

public static String getTagValueWithoutNamespace(Node n) 

Method Source Code


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

import org.w3c.dom.Node;

public class Main {
    /**/* w  ww .  ja  v  a 2s  .  c  om*/
     * Gets the tag value without namespace.
     * 
     * @param n
     *            the n
     * @return the tag value without namespace
     */
    public static String getTagValueWithoutNamespace(Node n) {
        if (n != null) {
            String tag = n.getNodeName();
            return tag.substring(tag.indexOf(":") + 1, tag.length());
        }
        return null;
    }
}

Related

  1. getString(Node node)
  2. getStringValue(NamedNodeMap values, String name)
  3. getStringValue(Node node)
  4. getStringValue(Node node)
  5. getTagValue(Node node, String name)
  6. getText(final Node node)
  7. getText(final Node xmlNode)
  8. getText(Node elem)
  9. getText(Node elem, StringBuilder buffer)