Java XML Attribute Get getAttribute(String name, Element el)

Here you can find the source of getAttribute(String name, Element el)

Description

Gets the value of the given DOM element's attribute with the specified name.

License

Open Source License

Declaration

public static String getAttribute(String name, Element el) 

Method Source Code

//package com.java2s;

import org.w3c.dom.*;

public class Main {
    /**//from   ww w.jav a2s. com
     * Gets the value of the given DOM element's attribute
     * with the specified name.
     */
    public static String getAttribute(String name, Element el) {
        if (name == null || el == null)
            return null;
        if (!el.hasAttribute(name))
            return null;
        return el.getAttribute(name);
    }
}

Related

  1. getAttribute(String aAttrName, Node aNode)
  2. getAttribute(String attribute, Node node)
  3. getAttribute(String attribute, Node node)
  4. getAttribute(String attribute, Node node)
  5. getAttribute(String key, NamedNodeMap map)
  6. getAttribute(String name, Element element)
  7. getAttribute(String name, Element firstElement, Element secondElement)
  8. getAttribute(String name, Node node)
  9. getAttributeAsBoolean(Element elem, String attribName)