Write xml file with lxml

Posted by systempuntoout on Stack Overflow See other posts from Stack Overflow or by systempuntoout
Published on 2010-05-14T09:48:58Z Indexed on 2010/05/14 9:54 UTC
Read the original article Hit count: 264

Filed under:
|
|

Having a code like this:

from lxml import etree

root = etree.Element("root")
root.set("interesting", "somewhat")
child1 = etree.SubElement(root, "test")

How do i write root Element object to an xml file using write() method of ElementTree class?

© Stack Overflow or respective owner

Related posts about lxml

Related posts about python