List of utility methods to do XML Child Element Text
String | getChildText(Element tag, String childTagName) get Child Text Element child = getFirstChild(tag, childTagName); if (child != null) { return getNodeText(child); return ""; |
String | getChildText(final Element element, final String tagName) get Child Text final Element childElement = getChild(element, tagName); if (childElement == null) { return null; final String text = childElement.getTextContent(); return (text == null) ? null : text.trim(); |
String | getChildText(final Element element, final String tagName) Obtains the text value inside the first child element with the specified tag name. final Element child = getChildElement(element, tagName); return getText(child); |
String | getChildText(final Element parentElem, final String childName) Gets the text content of a child element. NodeList childList = parentElem.getElementsByTagName(childName); if (childList.getLength() > 0) { Node child = childList.item(0); return child.getTextContent(); } else { return null; |
String | getChildText(final Node node) Returns the concatenated child text of the specified node. if (node == null) { return null; StringBuffer str = new StringBuffer(); Node child = node.getFirstChild(); while (child != null) { short type = child.getNodeType(); if (type == Node.TEXT_NODE) { ... |
String | getChildText(final Node node) get Child Text if (node == null) { return null; } else { final StringBuilder text = new StringBuilder(); appendChildText(text, node); return text.toString(); |
String | getChildText(Node node) Returns the value of the first child node of the given node, and asserts that the child node is a Text node. Node child = node.getFirstChild(); assert (child.getNodeType() == Node.TEXT_NODE); return child.getNodeValue(); |
String | getChildText(Node node) We get a object that connected text node of the child node and the CDATA section as character string. StringBuffer buf = new StringBuffer(); for (int i = 0; i < node.getChildNodes().getLength(); i++) { Node n = node.getChildNodes().item(i); if (n.getNodeType() == Node.TEXT_NODE || n.getNodeType() == Node.CDATA_SECTION_NODE) { buf.append(n.getNodeValue()); return buf.toString(); ... |
String | getChildText(Node node) Returns the concatenated child text of the specified node. if (node == null) { return null; StringBuffer str = new StringBuffer(); Node child = node.getFirstChild(); while (child != null) { short type = child.getNodeType(); if (type == Node.TEXT_NODE) { ... |
String | getChildText(Node parent, String childName) Returns the text value of a given child element. Element elem = findFirstChild(parent, childName); if (elem == null) return null; return getElementText(elem); |