Android examples for XML:XML Node
Utility method to fetch the value of the XML element node
// Copyright (c) 2004-2008 IBM Corporation and others. All Rights Reserved. //package com.java2s; import org.w3c.dom.*; public class Main { /**//from w ww . ja v a 2s .co m * Utility method to fetch the value of the element node * @param node * @return */ public static String getNodeValue(Node node) { for (Node child = node.getFirstChild(); child != null; child = child .getNextSibling()) { if (child.getNodeType() == Node.TEXT_NODE) { return child.getNodeValue(); } } return null; } }