Hello. I have been finding more and more databases
that output in XML. (Getting more popular all the time I guess!)

I am building a script that will take this apart so I can edit items and put it back together in XML format and .cvs format. (to feed to a Spreadsheet).

I am asking because I have only been playing with Python for a week now and some of you might know of some package or routine that does this for me real quick. I am writing a script to just parse it , edit some
values based on another database and paste it back together again.
I have seen some XML class XMLParser( ) deals but do not understand them.

XML example of the data

?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Application</key>
<string>SYSTEM31-STMem</string>
<key>ListMem.-2147483648</key>
<dict>
<key>default</key>
<string>2</string>
<key>elements</key>
<array>
<array>
<string>13242</string>
<string>First001</string>
<string>14545554</string>
<string>FDCM</string>
<string>1</string>
<string>Off</string>
<string>15144</string>
<string>Off</string>
<string>-</string>
<string>GRAPH</string>
<string>Off</string>
<string>Off</string>
<string></string>
<string></string>
<string></string>
<string></string>
<string></string>
<string></string>
<string></string>
<string>Edit</string>
</array>

Repeats the above /array 45207 times.

</array>
</dict>
</dict>
</plist>

Thanks
Dave

hi,

you tried something with the xmlparser module? where have you stuck?

kath.

Thanks for your response. I have looked at the XMLParser page but I do not understand much of it. (http://docs.python.org/lib/xmlparser-objects.htm)

Seems like you need to have other items used in building the XML database.
(which I do not have). DTDs?

I am just writing code that will take it apart the hard way. The databases I need to take apart are fixed. (eight) So I just need to find the variables names and slice them up to lists.

I need to read all about XML I guess to know how it works with databases. More and more web sites are using it to store data. Unless they needs more power they move to SQL based systems.

Dave

I just coded and coded. And now I am taking the db apart the hard way.
It is working.

Dave

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.