Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
During the execution of a httpPOST i store the response as a String and the response i am getting is like this:

VB
<?xml version = "1.0" encoding= "utf-8"?>
      string xmlns="http://localhost:4471/">101~Success</string>




I just want to get 101~Success after parsing so that i can get 101 by using split function but am not able to get this element in android.I was getting this in
J2ME as:


InputStream in = new ByteArrayInputStream(strResponse.getBytes("UTF-8"));
InputStreamReader is = new InputStreamReader(in);
parser = new XmlParser(is);
doc.parse( parser );

Element root = doc.getRootElement();
Element item = doc.getElement(2);
String parsedResponse = item.getText(0);

How can i do it in android using DOM Or XmlPullParser?
Posted
Updated 3-Feb-13 20:10pm
v2

1 solution

I dont have any idea about android but in dom you can you use getTextContent() method to extract the content.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900