Here you can find the source of getAttributValue(Node n, String name)
public static String getAttributValue(Node n, String name)
//package com.java2s; //License from project: BSD License import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; public class Main { public static String getAttributValue(Node n, String name) { if (n == null) return null; NamedNodeMap att = n.getAttributes(); if (att == null) return null; Node n2 = att.getNamedItem(name); if (n2 == null) return null; return n2.getNodeValue(); }/*from ww w . j ava 2 s . c om*/ public static String getNodeValue(Node n) { if (n == null) return null; return n.getTextContent(); } }