Here you can find the source of getAttribute(Element element, String attributeName)
public static String getAttribute(Element element, String attributeName)
//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); } }