Use DOM for do it

Sbaush <[email protected]>
Newsgroups gmane.comp.python.xml
Message-ID <[email protected]>
Hi all.
I've this function that write a XML string.
Is possible to do it without ElementTree but with DOM?
Thanks.

import sys
import elementtree.ElementTree as ET

root = ET.Element("manager")
req=ET.SubElement(root,"request")
app= ET.SubElement(req,"append")
app.set("mode","INPUT")
met=ET.SubElement(app,"method")
met.set("type","GOOD")
src=ET.SubElement(app,"source")
src.set("address"," 127.0.0.1")
act=ET.SubElement(app,"action")
act.set("option","OK")

tree = ET.ElementTree(root)
tree.write(sys.stdout)
print



--
Sbaush

_______________________________________________
XML-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/xml-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.