Here you can find the source of getAttrBool(Node n, String name)
public static boolean getAttrBool(Node n, String name)
//package com.java2s; //License from project: LGPL import org.w3c.dom.*; public class Main { public static boolean getAttrBool(Node n, String name) { if (n == null) return false; /* default value */ Node nn = n.getAttributes().getNamedItem(name); if (nn == null) return false; /* default value */ String value = nn.getNodeValue(); if (value == null) return false; /* default value */ if ("true".equals(value.toLowerCase())) return true; if ("1".equals(value.toLowerCase())) return true; return false; }//from w w w . j av a 2 s. co m }