Here you can find the source of getAttribute(String attribute, Node node)
public static String getAttribute(String attribute, Node node)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; public class Main { public static String getAttribute(String attribute, Node node) { if (node != null) { Node attr = node.getAttributes().getNamedItem(attribute); if (attr != null) { return attr.getNodeValue().trim(); }//from www . java2s. co m } return null; } }