Android XML Element Value Get getElementText(Element element)

Here you can find the source of getElementText(Element element)

Description

get Element Text

License

Open Source License

Declaration

public static String getElementText(Element element) 

Method Source Code

//package com.java2s;
//License from project: MIT License 

import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class Main {
    public static String getElementText(Element element) {
        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());
        }/*www  .j a  v a  2 s . c o  m*/
        return text.toString();
    }
}

Related

  1. getValue(Element element, String elementName)
  2. getValue(Element item, String str)
  3. getStringValue(String tag, Element element)
  4. getCData(Element element)
  5. getContent(Element xmlElement)
  6. getIntegerValue(String tag, Element element)