Android XML Node Search returnNodeValue(Node node)

Here you can find the source of returnNodeValue(Node node)

Description

Returns the value of an XML node.

Parameter

Parameter Description
node Node.

Return

String of node.

Declaration

public static String returnNodeValue(Node node) 

Method Source Code

//package com.java2s;
import org.w3c.dom.Node;

public class Main {
    /**/*from ww w. j  a v  a  2  s.c om*/
     * Returns the value of an XML node.
     * 
     * @param node Node.
     * @return String of node.
     */
    public static String returnNodeValue(Node node) {

        String text = node.getFirstChild().getTextContent();
        text = text.replaceAll("\\\\n", "\n");
        return text;

    }
}

Related

  1. findNamedElementNode(Node doc, String name)
  2. findNamedElementNodes(Node doc, String name)
  3. findNextElement(Node ret, String name)
  4. getOptionalXmlString(Node node, String xmlLocalName)
  5. selectNode(Node sibling, String uri, String nodeName, int number)
  6. selectNodeText(Node sibling, String uri, String nodeName, int number)
  7. selectNodes(Node sibling, String uri, String nodeName)