Java XML Attribute from Node getNodeAttributeValue(Node element, String attributeName)

Here you can find the source of getNodeAttributeValue(Node element, String attributeName)

Description

Insert the method's description here.

License

Apache License

Parameter

Parameter Description
element org.w3c.dom.Node
attributeName java.lang.String

Return

java.lang.String

Declaration

public static String getNodeAttributeValue(Node element, String attributeName) 

Method Source Code

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

import org.w3c.dom.Node;

public class Main {
    /**/*from   w w w.  j  a v  a  2  s  .  c o  m*/
     * Insert the method's description here.
     * 
     * @return java.lang.String
     * @param element
     *            org.w3c.dom.Node
     * @param attributeName
     *            java.lang.String
     */
    public static String getNodeAttributeValue(Node element, String attributeName) {
        Node tmpNode = element.getAttributes().getNamedItem(attributeName);
        String tmp = null;
        if (tmpNode != null)
            tmp = tmpNode.getNodeValue();
        return tmp;
    }
}

Related

  1. getNodeAttribute(Node thisNode, String key)
  2. getNodeAttributeAsInt(Node node, String attributeName, int defaultValue)
  3. getNodeAttributeDeep(NodeList nodelList, String nodeName, String nodeAttr)
  4. getNodeAttributes(final Node node)
  5. getNodeAttributesToString(Node node)
  6. getNodeAttributeValue(Node node, String attribute)
  7. getNodeAttributeValue(Node node, String attributeName)
  8. getNodeAttributeValue(Node node, String attributeName)
  9. getNodeAttributeValue(Node node, String attrName)