[XML-SIG] Python and DOM
Martin v. Loewis
martin@v.loewis.de
12 Mar 2002 21:57:57 +0100
Norman Samuelson <nhs@llnl.gov> writes:
> One way of doing that is to write the XML directly. That is a lot of
> work and can be difficult to maintain. I would like to try building a
> DOM tree, then simply let DOM write the tree out in XML. Is there a
> DOM interface for Python that would be suitable for that?
Certainly. Since Python 2.2, xml.dom.minidom is available; it is a DOM
2 Core implementation. Use xml.dom.minidom.parse to create a DOM tree;
use toxml() on the resulting tree to serialize the tree again.
HTH,
Martin