开发者

Error in parsing xml from web service

开发者 https://www.devze.com 2023-03-06 04:35 出处:网络
I have my xml file as a response in result.getProperty(0)开发者_开发百科. The code is as follows:

I have my xml file as a response in result.getProperty(0)开发者_开发百科.

The code is as follows:

SoapObject result=(SoapObject)envelope.bodyIn;    
System.out.println("value of result " + result);  

How can I store this xml in result.getProperty(0) into my sdcard/any other location so that I can parse it using SAXParser?

Regards,

sneha


The getProperty(int)-method returns an Object. If this Object is a String, the SAXParser supports parsing XML from a String: Link


I solved the problem in the following way :

xr.parse(new InputSource(new ByteArrayInputStream(result.getProperty(0).toString().getBytes())));  

Then I use SAXParser and parse the xml.

Thanks,
Sneha

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号