Click here to Skip to main content
13,560,107 members
Rate this:
Please Sign up or sign in to vote.
See more:
During the execution of a httpPOST i store the response as a String and the response i am getting is like this:

<?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 3-Feb-13 20:08pm
Updated 3-Feb-13 20:10pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180527.3 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100