|
Re: python with libxml2
|
Posted: Oct 20, 2008 9:08 AM
|
|
hello all iam newbie for creating file in python and i have task for my collage can you all help me the task like this i have file name for that file is example.txt and content of file like this elementary 30802160 1 15518 30802170 2 15530 juniorhigh 30802180 1 15518 3 0802190 2 15530 seniorhigh 30802200 1 15518 30802210 2 15530
and i want to convert to example.xml with content like this<object> <school province = "bali" object_id = "00009876"> <list school="base" > <object_ref name = "1"> 30802160</object_ref> <object_ref name = "2"> 30802170</object_ref> <object_ref name = "3"> 30802180</object_ref> <object_ref name = "4"> 30802190</object_ref> <object_ref name = "5"> 30802200</object_ref> <object_ref name = "6"> 30802210</object_ref> </list> <object classname = "elementary" object_id = " 30802160"> <integer name = "Sid">1</integer> <integer name = "Address">15518</integer> </object> <object classname = "elementary" object_id = " 30802170"> <integer name = "Sid">2</integer> <integer name = "Address">15530</integer> </object> <object classname = "juniorhigh" object_id = " 30802180"> <integer name = "Sid">1</integer> <integer name = "Address">15518</integer> </object> <object classname = "juniorhigh" object_id = " 30802190"> <integer name = "Sid">2</integer> <integer name = "Address">15530</integer> </object> <object classname = "seniorhigh" object_id = " 30802200"> <integer name = "Sid">1</integer> <integer name = "Address">15518</integer> </object> <object classname = "seniorhigh" object_id = " 30802210"> <integer name = "Sid">2</integer> <integer name = "Address">15530</integer> </object> </school> </object>
thanks for your help
|
|