List of utility methods to do XML Element Get Value
String | getTextValue(Element valueEle) get Text Value StringBuffer value = new StringBuffer(); NodeList nl = valueEle.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node item = nl.item(i); if ((item instanceof CharacterData && !(item instanceof Comment)) || item instanceof EntityReference) { value.append(item.getNodeValue()); return value.toString().trim(); |
String | getTextValue(Element valueEle) Extracts the text value from the given DOM element, ignoring XML comments. Assert.notNull(valueEle, "Element must not be null"); StringBuilder sb = new StringBuilder(); NodeList nl = valueEle.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node item = nl.item(i); if ((item instanceof CharacterData && !(item instanceof Comment)) || item instanceof EntityReference) { sb.append(item.getNodeValue()); return sb.toString(); |
String | getTextValue(Element valueEle) Extract the text symbol from the given DOM element, ignoring XML comments. StringBuffer value = new StringBuffer(); NodeList nl = valueEle.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node item = nl.item(i); if (item instanceof CharacterData && !(item instanceof Comment) || item instanceof EntityReference) value.append(item.getNodeValue()); return value.toString(); ... |
String | getTextValue(final Element elem) get Text Value if (elem == null) { return null; final StringBuilder str = new StringBuilder(); final NodeList list = elem.getChildNodes(); for (int i = 0; i < list.getLength(); i++) { final Node item = list.item(i); if ((item instanceof CharacterData && !(item instanceof Comment)) || item instanceof EntityReference) { ... |
String | getTextValue(final Element element, final String tagName) get Text Value Node n = getNode(element, tagName); if (n != null) { Node child = n.getFirstChild(); return (child == null) ? "" : child.getNodeValue(); return null; |
String | getTextWithoutTrim(Element elem) get Text Without Trim if (elem != null) { NodeList childNodes = elem.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { if (childNodes.item(i).getNodeType() == Node.TEXT_NODE) { return childNodes.item(i).getNodeValue(); return null; |
String | getTrimmedText(Element element) Get the trimmed text for an element, which is considered the first Text child element. String text = getText(element); if (text != null) return text.trim(); return null; |
String | getTrimmedTextContent(Element element) get Trimmed Text Content return (element != null) ? element.getTextContent().trim() : null;
|
String | getTrimmedTextContent(Element element) get Trimmed Text Content return (element != null) ? element.getTextContent().trim() : null;
|
String | getTrimmedTextValue(Element valueEle) Retruns the trimmed text value of the DOM element. return getTextValue(valueEle).trim();
|