Here you can find the source of getInteger(final org.w3c.dom.Element element, final String attr, int def)
public static int getInteger(final org.w3c.dom.Element element, final String attr, int def)
//package com.java2s; public class Main { /**/* w w w . j a va 2 s .c o m*/ * Returns the integer value of the given XML attribute; or the default value. */ public static int getInteger(final org.w3c.dom.Element element, final String attr, int def) { if (element.getAttributeNode(attr) == null) return def; try { return Integer.parseInt(element.getAttribute(attr).trim()); } catch (NumberFormatException e) { // no exceptiion handling required return def; } } }