Here you can find the source of getAttribute(Element element, String name)
public static String getAttribute(Element element, String name)
//package com.java2s; import org.w3c.dom.*; public class Main { public static String getAttribute(Element element, String name) { Attr attr = element.getAttributeNode(name); return (attr != null) ? attr.getValue() : null; }//from www. ja va 2 s .c o m public static Node getAttribute(Node node, String name) { return node.getAttributes().getNamedItem(name); } }