Here you can find the source of readBooleanAttribute(Element elem, String name, boolean defaultValue)
public static boolean readBooleanAttribute(Element elem, String name, boolean defaultValue)
//package com.java2s; import org.w3c.dom.Element; public class Main { public static boolean readBooleanAttribute(Element elem, String name, boolean defaultValue) { boolean back = defaultValue; String str = elem.getAttribute(name); if (str != null) { if (str.length() > 0) { int hash = str.hashCode(); if ((hash == "yes".hashCode()) || (hash == "true".hashCode())) { back = true;//ww w .j av a 2 s . c om } else { back = false; } } } return back; } }