Here you can find the source of getAttributeValueAsLong(final Element el, final String attrName, final long defaultVal)
public static long getAttributeValueAsLong(final Element el, final String attrName, final long defaultVal)
//package com.java2s; //License from project: Apache License import javax.xml.namespace.QName; import org.w3c.dom.Element; public class Main { public static long getAttributeValueAsLong(final Element el, final String attrName, final long defaultVal) { return getAttributeValueAsLong(el, new QName(attrName), defaultVal); }/*from ww w. j a va 2 s .c om*/ public static long getAttributeValueAsLong(final Element el, final QName attrName, final long defaultVal) { final String attrVal = getAttributeValue(el, attrName); return attrVal != null ? new Long(attrVal) : defaultVal; } public static String getAttributeValue(final Element el, final String attrName) { return getAttributeValue(el, new QName(attrName)); } public static String getAttributeValue(final Element el, final String attrName, final String defaultVal) { final String retval = getAttributeValue(el, new QName(attrName)); return retval == null ? defaultVal : retval; } public static String getAttributeValue(final Element el, final QName attrName) { String attr = null; if ("".equals(attrName.getNamespaceURI())) { attr = el.getAttribute(attrName.getLocalPart()); } else { attr = el.getAttributeNS(attrName.getNamespaceURI(), attrName.getLocalPart()); } if ("".equals(attr)) { attr = null; } return attr; } }