Here you can find the source of readIntegerAttribute(Element elem, String name, int defaultValue)
public static int readIntegerAttribute(Element elem, String name, int defaultValue)
//package com.java2s; import org.w3c.dom.Element; public class Main { public static int readIntegerAttribute(Element elem, String name, int defaultValue) { int back = defaultValue; String str = elem.getAttribute(name); if (str != null) { if (str.length() > 0) { back = Integer.parseInt(str); }//from www . ja v a 2 s.c o m } return back; } }