Java XML Attribute Get getAttribute(Element element, String attributeName)

Here you can find the source of getAttribute(Element element, String attributeName)

Description

get Attribute

License

Open Source License

Declaration

public static String getAttribute(Element element, String attributeName) 

Method Source Code

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

import org.w3c.dom.Element;

public class Main {
    public static String getAttribute(Element element, String attributeName) {
        return (element.hasAttribute(attributeName) ? element.getAttribute(attributeName) : null);
    }/*www  .jav a 2s .  c o m*/

    public static String getAttribute(Element element, String namespaceName, String attributeName) {
        return (element.hasAttributeNS(namespaceName, attributeName)
                ? element.getAttributeNS(namespaceName, attributeName)
                : null);
    }
}

Related

  1. getAttribute(Element elem, String name, String def)
  2. getAttribute(Element element, String attr)
  3. getAttribute(Element element, String attribute)
  4. getAttribute(Element element, String attribute, String defaultValue)
  5. getAttribute(Element element, String attributeName)
  6. getAttribute(Element element, String attributeName, float deflt)
  7. getAttribute(Element element, String attrName)
  8. getAttribute(Element element, String name)
  9. getAttribute(Element element, String name)