Possible Duplicate:
xml parsing in android
i have to parse the below give file in xml format -
The url for above file is http://simplyappointments.com/[email protected]
Can anybody help me in this.... I will be very thankful to you.
Possible Duplicate:
xml parsing in android
i have to parse the below give file in xml format -
The url for above file is http://simplyappointments.com/[email protected]
Can anybody help me in this.... I will be very thankful to you.
You can just use the normal Java DOM stuff.
For instance to retrieve the value of the Transaction attribute from the given link:
DocumentBuilder builder = DocumentBuilderFactory.newInstance()
.newDocumentBuilder();
String urlStr = "http://simplyappointments.com/businessinfoxml.php"+
"[email protected]";
InputStream inputStream = new URL(urlStr).openStream();
InputSource inputSource = new InputSource(inputStream);
Document doc = builder.parse(inputSource);
Element element = (Element) doc.getElementsByTagName("businessinfo").item(0);
return element.getAttribute("Transaction");
If you must retrieve an XML document through the network make sure you have <uses-permission android:name="android.permission.INTERNET" />
in your Android manifest.