Questions about parsing XML

Kyle Root kyleroot at gmail.com
Sat Aug 7 15:34:51 CEST 2004


I'm writing a practice program that parses an xml config file, at the 
moment I'm using expat.  However I don't like some of it's behaviors. 
For example ParseFile() will parse the *entire* file and I don't want to 
do that.  I would like to be able to tell it to find such and such a tag 
and return the cdata it contains, is this at all possible?  If it is how 
would I handle optional tags?

If it's not possible and the entire file does have to be parsed in one 
fell swoop, are there any special ways collecting the data into a usable 
form?  I tried to put everything into a list, but that's not very 
practicle, especially with optional tags.

Thanks,
Kyle



More information about the Python-list mailing list