Here you can find the source of attributeIntValue(Element e, String attr)
public static int attributeIntValue(Element e, String attr)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; public class Main { public static int attributeIntValue(Element e, String attr) { return attributeIntValue(e, attr, null); }// w w w . ja va2 s . c om public static int attributeIntValue(Element e, String attr, Integer defaultValue) { if (!e.hasAttribute(attr)) { return defaultValue; } if (e.getAttribute(attr).equals("yes") || e.getAttribute(attr).equals("true")) { return 1; } return Integer.parseInt(e.getAttribute(attr)); } }