[Tutor] xml parsing

alan.gauld@bt.com alan.gauld@bt.com
Thu Nov 21 12:48:53 2002


> little bit of documentation of the re module, I think I may 
> be able to figure out how to do this for the general situation 
> if I can come to understand the re module somewhat correctly.

Sorry, but you won't, regular expressions are the wrong tool for 
working with any serious level of XML. They don't handle 
recursive definitions at all well, and will get you tied up 
in ever increasing knots.

It may be a pain but you really need to persevere with the sax 
stuff - try asking on the Python XML sig mailing list, I'm sure 
the experts there will help you out. Also have you read all the 
tutorials on the XML pages of the python web site?

Trust me on this, trying to parse a completly unformatted XML
file using regular expressions is not something you want to do!

Alan g.
Author of the 'Learning to Program' web site
http://www.freenetpages.co.uk/hp/alan.gauld