DEVANG SHARMA
DEVANG SHARMA

Reputation: 2662

J2ME, Xml Response from Http Post Method

This is my Response String from HTTP Post Method

1)  <?xml version="1.0" encoding="utf-8"?>
    <string xmlns="http://tempuri.org/">Open</string>

2)  <?xml version="1.0" encoding="utf-8"?>
    <string xmlns="http://tempuri.org/">Close</string>

But I want only the Selected Or Result String from above lines

like from 1 response) I only want Open from 2 response) I only want Close

How I can get this.

please reply

Upvotes: 1

Views: 508

Answers (2)

Mohammad Ersan
Mohammad Ersan

Reputation: 12444

you can use kXML2 xml parsing api

Upvotes: 2

funkybro
funkybro

Reputation: 8671

If your handset supports JSR 172 you can follow this example to parse the data out. Otherwise you will need to write your own rudimentary string splitting/tokenizing. If you can guarantee the data is always in the format you've given, it won't be very hard.

Upvotes: 1

Related Questions