Here you can find the source of getLongAttribute(String name, Element el)
public static Long getLongAttribute(String name, Element el)
//package com.java2s; import org.w3c.dom.*; public class Main { /**/*from w w w . j a v a2 s.c om*/ * Gets the value of the DOM element's attribute with the given name * as a Long, or null if the value is not a long. */ public static Long getLongAttribute(String name, Element el) { return stringToLong(getAttribute(name, el)); } private static Long stringToLong(String value) { if (value == null) return null; try { return new Long(value); } catch (NumberFormatException exc) { return null; } } /** * Gets the value of the given DOM element's attribute * with the specified name. */ public static String getAttribute(String name, Element el) { if (name == null || el == null) return null; if (!el.hasAttribute(name)) return null; return el.getAttribute(name); } }