How to serialize an xml document in Python

Levente Sandor sandorlevi at yahoo.com
Thu Mar 20 02:41:04 CET 2003


src = doc.toxml()

----
levi

antun at antunkarlovac.com (Antun Karlovac) wrote in message news:<faa2f5ac.0303191153.5ba77707 at posting.google.com>...
> This sounds like a REALLY easy question, but for the life of me I
> can't seem to find a solution. I've created an XML document as
> follows:-
> 
>         impl = xml.dom.minidom.getDOMImplementation()
>         doc = impl.createDocument( None, "element", None )
>        
> 
> And then I added plenty of nodes to it.
> 
> So far I've been printing it out to the console:
> 
>         xml.dom.ext.PrettyPrint( doc )
> 
> But now I want to assign the serialized string of the XML to a
> variable.
> 
> How do I do that?
> 
> -Antun




More information about the Python-list mailing list