Java XML Attribute from Element getElementAttr(Element element, String attr)

Here you can find the source of getElementAttr(Element element, String attr)

Description

Get the value of the attribute of the element

License

Apache License

Parameter

Parameter Description
element a parameter
attr a parameter

Declaration

public static String getElementAttr(Element element, String attr) 

Method Source Code

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

import org.w3c.dom.Element;

public class Main {
    /**/* w w  w .  j a va2  s  . c om*/
     * Get the value of the attribute of the element
     *
     * @param element
     * @param attr
     * @return
     */
    public static String getElementAttr(Element element, String attr) {
        return element.getAttribute(attr);
    }
}

Related

  1. getElement(Element root, String tagName, String attrName, String attrValue)
  2. getElementArrayInt(Element root, String name, String attrib)
  3. getElementArrayString(Element root, String name, String attrib)
  4. getElementAttribute(Element element, String name)
  5. getElementAttribute(Element root, String elementName, String attribute)
  6. getElementAttribute(Element root, String elemName, String att)
  7. getElementAttributes(Element element, List exclude)