Android Utililty Methods XML Element Value Get

List of utility methods to do XML Element Value Get

Description

The list of methods to do XML Element Value Get are organized into topic(s).

Method

StringgetCData(Element element)
Extract the CDATA content of the specified element.
CDATASection text = getCDataNode(element);
return (text == null) ? null : text.getData().trim();
StringgetContent(Element xmlElement)
Get the content value for the given XML element
if (xmlElement == null) {
    throw new IllegalArgumentException("xmlElement cannot be null");
StringBuilder content = new StringBuilder();
for (Node childNode = xmlElement.getFirstChild(); childNode != null; childNode = childNode
        .getNextSibling()) {
    if (childNode.getNodeType() == Node.TEXT_NODE) {
        content.append(childNode.getNodeValue());
...
StringgetElementText(Element element)
get Element Text
StringBuilder text = new StringBuilder();
NodeList childNodes = element.getChildNodes();
int numChildren = childNodes.getLength();
for (int j = 0; j < numChildren; j++) {
    text.append(childNodes.item(j).getNodeValue());
return text.toString();
IntegergetIntegerValue(String tag, Element element)
get Integer Value
return Integer.parseInt(getStringValue(tag, element), 10);