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.
Alexandre Jasmin
2010-10-22 06:50:07