Choosing SAX parsers

Graham Ashton graham at coms.com
Sun Jun 24 12:37:42 EDT 2001


I've just started playing with xml.sax and the XML HOWTO. I had to
recompile python to include expat as I didn't have any other parsers
available (python 2.1, built from source, Debian Linux).

This is fine, and xml.sax works nicely with expat now that I've
recompiled, but I was a bit surprised that expat was the only parser
availble after the docs had been telling me how I could choose between
parsers, etc. Am I missing some stuff?

What I'd really like is a parser that knows how to enforce DTDs, which I
know expat-1.x doesn't. Speed isn't an issue for me as my documents are
very small.

What's my best bet? Installing PyXML? If I do, will it overwrite the xml.*
module tree that I've got already? Are there any issues installing it over
the top of the stuff in the standard library (some of which I believe is
the same codebase)?

Any pointers would be much appreciated. Thanks.

--
Graham



More information about the Python-list mailing list