I am parsing a XML file as follows:
<ROW>
<INDUSTRY_ID>1</INDUSTRY_ID>
<ID>314</ID>
</ROW>
Here's my code:
NodeList titleList = list.getElementsByTagName("ROW");
Log.w("nodeName is ",titleList.item(0).getChildNodes().item(1).getFirstChild().getNodeName());
Log.w("nodeValue is ",titleList.item(0).getChildNodes().item(1).getFirstChild().getNodeName());
I can successfully obtain the content of the tag and tag, namely, I got "1" and "314" resp.; However, I got #text from getNodeName(). I have also tried:
titleList.item(0).getChildNodes().item(1).getFirstChild().getNodeName().toString()
But I was still getting #text. My question is how do I get "INDUSTRY_ID" and "ID" instead?