Here you can find the source of getNodeAttrValue(Element parent, String nodeName, String attrName)
public static String getNodeAttrValue(Element parent, String nodeName, String attrName)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; public class Main { public static String getNodeAttrValue(Element parent, String nodeName, String attrName) {/* www .j a v a2 s. c o m*/ try { return ((Element) parent.getElementsByTagName(nodeName).item(0)) .getAttribute(attrName); } catch (Exception e) { e.printStackTrace(); } return null; } }