Here you can find the source of returnNodeValue(Node node)
Parameter | Description |
---|---|
node | Node. |
public static String returnNodeValue(Node node)
//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; } }