Java XML Attribute Get getAttributName(Node node)

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

Description

get Attribut Name

License

Open Source License

Declaration

public static Object getAttributName(Node node) 

Method Source Code

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

import org.w3c.dom.Node;

public class Main {
    public static String VALUE = "rng:value";
    public static String ATTRIBUT_NAME_ATTRIBUT = "name";

    public static Object getAttributName(Node node) {
        return node.getAttributes().getNamedItem(ATTRIBUT_NAME_ATTRIBUT)
                .getNodeValue();/*from  ww w  . j  a  v a2s  .c o m*/
    }

    public static Node getNodeValue(Node node) {

        for (int i = 0; i < node.getChildNodes().getLength(); i++) {
            Node n = node.getChildNodes().item(i);
            if (n.getNodeName().equals(VALUE)) {
                return n;
            }
        }

        return null;
    }
}

Related

  1. getAttributeValueOrNull(NamedNodeMap attributes, String attributeName)
  2. getAttributeValuePair(Node node)
  3. getAttributeValues(Element el)
  4. getAttributeValues(Node node, String nodeName, String attrName)
  5. getAttributeWithInheritance(Element element, String attributeName)
  6. getAttributValue(Node n, String name)
  7. getAttrInt(Element root, String attrName)
  8. getAttrList(Node node)
  9. getAttrName(String prefix, String name)