Here you can find the source of getAttributeValue(Node node, String attName)
public static String getAttributeValue(Node node, String attName)
//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 getAttributeValue(Node node, String attName) { if (attName == null || attName.trim().length() == 0) { return null; }/*from w ww . j a v a2s.c o m*/ NamedNodeMap attMap = node.getAttributes(); for (int index = 0; index < attMap.getLength(); index++) { Node aNode = attMap.item(index); String aName = aNode.getNodeName(); if (attName.equals(aName)) { return aNode.getNodeValue(); } } return null; } }