Java XML Attribute from Element getXMLAttributeValue(Element node, String attributeName)

Here you can find the source of getXMLAttributeValue(Element node, String attributeName)

Description

Get the value of an attribute that belongs to an XML element.

License

Apache License

Parameter

Parameter Description
node XML element
attributeName Name of the attribute

Declaration

public static String getXMLAttributeValue(Element node, String attributeName) 

Method Source Code

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

import org.w3c.dom.Element;

public class Main {
    /**/*from   w w w.ja  v  a2s .  co m*/
     * Get the value of an attribute that belongs to an XML element.
     * 
     * @param node
     *            XML element
     * @param attributeName
     *            Name of the attribute
     * @return
     */
    public static String getXMLAttributeValue(Element node, String attributeName) {
        return node.getAttribute(attributeName);
    }
}

Related

  1. getValue(final Element elem, final String attrName)
  2. getValueAttribute(final Node aNode)
  3. getValueAttributeUri(Element parent, String defaultBaseUri)
  4. getValueForAttribute(String attributeName, Node parentNode)
  5. getXMLAttribute(Element element, String attrName)
  6. getXMLAttributeValueAsBoolean(Element node, String attributeName)
  7. incrementAttributeValue(Node node, String attName)
  8. isHTMLInputFileValueAttr(Node node, String attrName)