Java examples for XML:DOM Node Value
read XML Sub Node Int Value
//package com.java2s; import org.w3c.dom.Node; public class Main { public static int readSubNodeIntValue(Node n, String name, int dflt) { if (name == null) return dflt; for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling()) if (name.equalsIgnoreCase(d.getNodeName())) return Integer.parseInt(d.getNodeValue()); return dflt; }//w w w. j a va 2 s . c o m }