public void genericXmlParsing(String raw) throws Exception{
DocumentBuilder builder = DocumentBuilderFactory
.newInstance()
.newDocumentBuilder();
Document doc = builder.parse(new InputSource(new StringReader(raw)));
NodeList elementNames = doc.getElementsByTagName("ElementName");
NodeList elementValues = doc.getElementsByTagName("ElementValue");
for(int i=0;i
ParsedXmlData parsedXmlData = new ParsedXmlData();
parsedXmlData.setElementName(elementName.getFirstChild().getNodeValue());
parsedXmlDataList.add(parsedXmlData);
}
for(int i=0;i
ParsedXmlData parsedXmlData = parsedXmlDataList.get(i);
parsedXmlData.setElementValue(elementValue.getFirstChild().getNodeValue());
}
}
Hi thanks for reply,
ReplyDeleteI have done this bt not able to display the List of attributes in XML file
How it will code in oncreate() method.
pls help me regard this..
How to parse such a file?? please any help??
ReplyDeletewww.codemobiles.com, since
www.codemobiles.com1, since