01 April 2006 ~ 3 Comments

Parsing XML in Python

Sugree (of line-by-line comparison fame) posted what may be the shortest Python XML parsing tutorial of all time. It covers the basics, but I would imagine that’s all most people need.

3 Responses to “Parsing XML in Python”

  1. Mateusz ?oskot 1 April 2006 at 6:58 am Permalink

    Nice tutorial, I wish to have it when I was working on my PyEPSGLookup utility. Hmm or may be I made a good decision to use SAX instead of DOM, because I’m just parsing to read data from XML file. What do you think?

  2. John 1 April 2006 at 11:21 am Permalink

    Yeah, from the tutorial it sounds like SAX is the way to go if you are only reading (and not writing) XML data.

    Last time I tried to handle data I used MiniDOM, and while it wasn’t “hard”, perhaps SAX would have been easier. Perhaps I should revisit that project and try again.


Leave a Reply