Here you can find the source of getAttributeValueAsInt(Node node, String attributeName)
static Integer getAttributeValueAsInt(Node node, String attributeName)
//package com.java2s; import org.w3c.dom.Node; public class Main { static Integer getAttributeValueAsInt(Node node, String attributeName) { if (node == null || attributeName == null) { return null; }/*from www . j a v a 2s . com*/ try { return Integer.valueOf(Integer.parseInt(getAttributeValue(node, attributeName))); } catch (NumberFormatException e) { return null; } } static String getAttributeValue(Node node, String attributeName) { if (node == null || attributeName == null) { return null; } Node attrNode = node.getAttributes().getNamedItem(attributeName); return attrNode != null ? attrNode.getNodeValue() : null; } static String getNodeValue(Node node) { return (node == null || node.getFirstChild() == null || node .getFirstChild().getNodeValue() == null) ? null : node .getFirstChild().getNodeValue().trim(); } }