[XML-SIG] Serializing DOM tree to file

Ian Sparks Ian.Sparks@etrials.com
Fri, 16 May 2003 18:23:25 -0400


Something more than?

            file =3D open('file.xml','w')
            file.write(dom.toprettyxml(indent=3D'  '))
            file.close()

-----Original Message-----
From: Nickolay Kolev [mailto:nmkolev@uni-bonn.de]
Sent: Friday, May 16, 2003 5:58 PM
To: xml-sig@python.org
Subject: [XML-SIG] Serializing DOM tree to file


Hi all,

I am having trouble finding a way to simply serialize a DOM tree to a
file. I have been googling for half an hour and still can find no info
on the subject.

Basically, what I want to do is to have what PrettyPrint from
xml.dom.ext writes to the console. But I want it in a file.

I am sure this has been discussed many times, I just cannot find any
info.

Many thanks in advance,
nmk

_______________________________________________
XML-SIG maillist  -  XML-SIG@python.org
http://mail.python.org/mailman/listinfo/xml-sig