Here you can find the source of getNodeTrimValue(NodeList nodeList)
Parameter | Description |
---|---|
nodeList | a parameter |
public static String getNodeTrimValue(NodeList nodeList)
//package com.java2s; //By using the Tapjoy SDK in your software, you agree to the terms of the Tapjoy SDK License Agreement. import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { /**/* ww w. j a v a 2s . c om*/ * Helper class to help parse the server response. * * @param nodeList * @return */ public static String getNodeTrimValue(NodeList nodeList) { Element element = (Element) nodeList.item(0); String nodeValue = ""; if (element != null) { NodeList itemNodeList = element.getChildNodes(); int length = itemNodeList.getLength(); for (int i = 0; i < length; i++) { Node node = ((Node) itemNodeList.item(i)); if (node != null) nodeValue += node.getNodeValue(); } if (nodeValue != null && !nodeValue.equals("")) { return nodeValue.trim(); } else { return null; } } return null; } }