Android examples for XML:XML Node
get XML Node Int Value
//package com.java2s; import org.w3c.dom.Node; public class Main { public static long getNodeIntValue(Node node, int defaultValue) { int value = defaultValue; try {//from w ww . j a v a 2 s .co m if (node.getFirstChild() != null) value = Integer.parseInt(node.getFirstChild() .getNodeValue()); } catch (Exception e) { value = defaultValue; } return value; } public static String getNodeValue(Node node) { String value = ""; try { if (node.getFirstChild() != null) value = node.getFirstChild().getNodeValue(); } catch (Exception e) { value = null; } return value; } }