Parse xml file

L

loial

Is there a quick way to retrieve data from an xml file in python 2.4,
rather than read the whole file?
 
B

Balamurugan S

Is there a quick way to retrieve data from an xml file in python 2.4,
rather than read the whole file?

Universal Feed parser can do the job for you.
This can be imported and used in your python programs.

For more information,
http://www.feedparser.org/


--
Regards,

S.Balamurugan

Free the code, Free the User
 
S

Stefan Behnel

loial said:
Is there a quick way to retrieve data from an xml file in python 2.4,
rather than read the whole file?

ElementTree is available as an external package for Py2.4 (and it's in the
stdlib xml.etree package since 2.5).

It's pretty much the easiest way to get data out of XML files.

If your statement "rather than read the whole file" was referring to the
file size, note that the C implementation "cElementTree" of ElementTree is
very memory efficient, so you might still get away with just reading the
whole file into memory. There's also the iterparse() function which
supports iterative parsing of an XML file and thus allows intermediate
cleanup of used data.

Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,197
Messages
2,571,041
Members
47,643
Latest member
ashutoshjha_1101

Latest Threads

Top