Here you can find the source of readIntAttr(Element element, String attributeName, int defaultValue)
public static int readIntAttr(Element element, String attributeName, int defaultValue)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; public class Main { public static int readIntAttr(Element element, String attributeName, int defaultValue) { String attributeValue = element.getAttribute(attributeName); try {/*from w w w .j av a2 s .c om*/ return Integer.parseInt(attributeValue); } catch (NumberFormatException e) { return defaultValue; } } }