Help on formatting xml document

Nitin Pawar nitinpawar432 at gmail.com
Mon Oct 4 02:14:02 EDT 2010


use minidom to parse from string and then write it to a file

from xml.dom.minidom import parse, parseString

parseString(rawdata)



On Mon, Oct 4, 2010 at 11:33 AM, Santosh Mohan <santosh.mce at gmail.com>wrote:

> Hi,
>
> Need help in formatting xml document using xml.doc.minidom
>
>
> I have a raw xml output, I need to format the xml output and write it to a
> file.
>
>
> rawdata="""  <head> <body> <name>Santosh</name> <age>29</age>
> <place>Bangalore</place> </body> </head>"""
>
> I would appreciate your help.
>
> Thanks,
> Santosh
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>


-- 
Nitin Pawar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20101004/2201b06f/attachment-0001.html>


More information about the Python-list mailing list