Click here to Skip to main content
12,243,522 members (44,777 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: Java Mobile Android
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/">



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 21:08pm
AkshiD444
Edited 3-Feb-13 21:10pm
v2

1 solution

Rate this: bad
 
good
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.
  Permalink  

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 | Mobile
Web01 | 2.8.160426.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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