PDA

View Full Version : Object converstion to xml format



Sameer Khan
5 Jan 2012, 9:44 PM
Hi, I want to convert Object data [Records from SQLite DB] to xml format and at the same time i want to add some root element to those records which red by me from sqlite db...Is it possible to do like this...
Ex:Object: {id:1,name:'Raja',location:'India',job:'s/w eng'} from sqlite db.
Root Element is -- Details
XML Should be like this:
<Details>
<id>1</id>
<name>Raja</name>
<location>India</location>
<job>s/w engineer</job>
</Details>
plz help me thanks...

mitchellsimoens
6 Jan 2012, 8:26 AM
There is no built in way to do this. You will need to iterate through the object/arrays and create the XML string yourself.