In 4Suite we have a fairly robust and speedy set of DOM serialization routines. To date, we've made sure it works equally well with both minidom and Domlette. Is there any interest in porting this into minidom as a replacement for the buggy .toxml()? Seems like it would alleviate a bit of frustration.
In 4Suite, the public interface is the Print() and PrettyPrint() functions in Ft.Xml.Domlette; you just call one or the other, passing in what you want to serialize, and they'll walk the DOM, generating SAX-like events that are handled by an instance of the right kind of serializer. The walker detects the type of DOM (HTML or XML) automatically, but this can be overridden to force a certain kind of output. The user can also choose the output stream (file-like object) and character encoding, of course. (user functions and DOM walker) =============================== http://cvs.4suite.org/viewcvs/4Suite/Ft/Xml/Lib/Print.py?view=markup (DOM walker handlers for different kinds of serialization) ========================================================== http://cvs.4suite.org/viewcvs/4Suite/Ft/Xml/Lib/XmlPrinter.py?view=markup http://cvs.4suite.org/viewcvs/4Suite/Ft/Xml/Lib/XmlPrettyPrinter.py?view=markup http://cvs.4suite.org/viewcvs/4Suite/Ft/Xml/Lib/HtmlPrinter.py?view=markup http://cvs.4suite.org/viewcvs/4Suite/Ft/Xml/Lib/HtmlPrettyPrinter.py?view=markup (entity/char ref-aware stream writer needed by all of the above) ================================================================ current version (a Python C extension only): http://cvs.4suite.org/viewcvs/4Suite/Ft/Xml/src/StreamWriter.c?view=markup last pure-Python version (no longer maintained, but is just 1 patch behind the C version, presently): http://cvs.4suite.org/viewcvs/4Suite/Ft/Xml/Lib/StreamWriter.py?hideattic=0&view=markup -Mike _______________________________________________ XML-SIG maillist - XML-SIG@python.org http://mail.python.org/mailman/listinfo/xml-sig