views:

486

answers:

3

Is there a way in Python to handle XML files similar to the way PHP's SimpleXML extension does them?

Ideally I just want to be able to access certain xml datas from a list object.

+1  A: 

There is a long list of libraries associated with XML processing on the Python wiki. Note that a number of them are included in the standard library. Most of them will do what you are looking for:

to access certain xml datas from a list object

which is a bit vague, and perhaps some more concrete use-case might narrow down that list for you.

Ali A
A: 

You might be referring to something like this:

http://github.com/joestump/python-simplexml

I haven't used it myself, but I was also looking for something like simplexml in PHP and this link showed up.

Andrei
A: 

You might want to try xml.etree.ElementTree It provides many easy ways to access read xml and to build new xml.

Or better yet use lxml.etree that provides even more convenient ways of accessing the nodes (such as xpath)

Kamil Szot