say I have an XML node and I need to get content of a certain element, say
NodeList nodes = doc.getElementsByTagName("msg");
for (int i = 0; i < nodes.getLength(); i++) {
Element e = (Element)nodes.item(i);
Log.e("XML: " , e.get... WHAT GOES INTO HERE ...("id") );
}
and I need the get the content of the “id” element, what’s the best way to do it?
Thanks!
If the structure of your XML looks something like this:
Then you can do this to access the contents of the id node: