Here you can find the source of getNodeAttribute(Node node, String s)
public static String getNodeAttribute(Node node, String s)
//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 getNodeAttribute(Node node, String s) { NamedNodeMap attributes = node.getAttributes(); for (int k = 0; k < attributes.getLength(); k++) { Node nodeAttr = attributes.item(k); if (nodeAttr.getNodeName().equals(s)) { return nodeAttr.getNodeValue(); }//from w ww. ja v a 2s .co m } return null; } }