Here you can find the source of getAttrOfName(Node node, String string)
public static String getAttrOfName(Node node, String string)
//package com.java2s; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; public class Main { public static String getAttrOfName(Node node, String string) { NamedNodeMap attributes = node.getAttributes(); Node namedItem = attributes.getNamedItem(string); if (namedItem == null) { return null; }//from w w w . j a va2 s .co m return namedItem.getNodeValue(); } }