Here you can find the source of getAttr(Node n, String name)
public static String getAttr(Node n, String name)
//package com.java2s; //License from project: LGPL import org.w3c.dom.*; public class Main { public static String getAttr(Node n, String name) { if (n == null) return null; Node nn = n.getAttributes().getNamedItem(name); if (nn != null) return nn.getNodeValue(); return null; }/* w ww. ja v a 2 s. c om*/ }