in the elementtree implementation the tostring function doesn't work with a tree, work only with an element. What is the way to put the tree in a string?

2006/1/20, Fredrik Lundh < [EMAIL PROTECTED]>:
Sbaush wrote:

> Is possible to have the XML in a string (for example xmlstring) and for
> printing do a print xmlstring ?

most about anything that can be written to a file can be written to a string
using the StringIO module:

     http://www.effbot.org/librarybook/stringio.htm

    file = StringIO.StringIO()
    tree.write(file)
    data = "">
for elementtree, you can also use the tostring function:

    data = "">
</F>



--
http://mail.python.org/mailman/listinfo/python-list



--
Sbaush
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to