Here you can find the source of getAttrValue(Node n, String name)
public static String getAttrValue(Node n, String name)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; public class Main { public static String getAttrValue(Node n, String name) { NamedNodeMap attrs = n.getAttributes(); return (attrs.getNamedItem(name) != null) ? attrs.getNamedItem(name).getNodeValue() : null; }//from w ww.j a v a 2s .c om }