Here you can find the source of getAttribute(Element elem, String name, String def)
public static String getAttribute(Element elem, String name, String def)
//package com.java2s; //it under the terms of the GNU Affero General Public License as published by import org.w3c.dom.Element; public class Main { public static String getAttribute(Element elem, String name, String def) { return elem.hasAttribute(name) ? elem.getAttribute(name) : def; }//from w w w .j av a 2 s . c o m }