Here you can find the source of getIntAttributeValue(Element element, String attribute)
public static int getIntAttributeValue(Element element, String attribute)
//package com.java2s; import org.w3c.dom.*; public class Main { public static int getIntAttributeValue(Element element, String attribute) { int ret;//www .j ava 2 s . c o m Attr attr = element.getAttributeNode(attribute); try { ret = Integer.valueOf(attr.getValue()); } catch (NumberFormatException e) { ret = 0; } return ret; } }