Here you can find the source of numResults(Document doc)
public static int numResults(Document doc)
//package com.java2s; import org.w3c.dom.Document; import org.w3c.dom.Node; public class Main { public static int numResults(Document doc) { Node results = doc.getDocumentElement(); int res = -1; try {//from ww w.ja v a 2 s . c om res = Integer.valueOf(results.getAttributes() .getNamedItem("count").getNodeValue()); } catch (Exception e) { res = -1; } return res; } }