XML using standard Python modules

Andrew Dalke dalke at dalkescientific.com
Wed Sep 12 13:05:27 EDT 2001


Martin von Loewis:
>All of the XML modules are primarily for reading XML (ie. parsing
>it). People argue that you can use the DOM also for constructing XML,
>but I have yet to see examples where that approach is simpler than
>plain print statements.

I've found it handy for my parser to generate SAX events then
use the SAX to XML text writer - xml.sax.saxutils.XMLGenerator.
In that way I don't have to worry about the details of how to
escape text and attributes.

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list