[Tutor] XML parsing

Suzanne Little s349929@student.uq.edu.au
Wed, 7 Feb 2001 08:49:31 +1000 (GMT+1000)


I doing some work with xml at the moment and I was hoping that someone
could give me some pointers. Currently I'm reading the file in, chopping
up the string using re.compile('<') and re.split() and then looking at each
'tag' that's in the result list to find the information I'm looking for
using regular expressions. This works but it can't be the only way to
extract information from an xml document. I've looked at the
xml.parsers.expat and the xml.sax modules including the HOWTO but I'm
don't really understand what they are capable of or when to use them.

Which module should I be using to do this? Are there any examples of this
sort of scanning-of-xml-documents-for-information available for me to look

Thanks for any and all help,

BTW the useless Python archive is excellent!

"Contrariwise," continued Tweedledee, "If it was so, it might be; and if
it were so, it would be; but as it isn't, it ain't.  That's logic"
                             -Lewis Carroll