Here you can find the source of getAttribute(Element e, String name)
public static String getAttribute(Element e, String name)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; public class Main { public static String getAttribute(Element e, String name) { if (e.getAttribute(name) == null) return ""; return e.getAttribute(name); }/*from w w w . ja va 2s. c o m*/ }