Jim wrote:
You want to pretty print. Have a look at
http://www.boddie.org.uk/python/XML_intro.html
for example.
Thank you to Paul, I've found that page useful,
Let me know if there's anything else that you think it should cover!
After updating the HTML parsing page and rediscovering some
Hi,
I have an XML file in a single long string. How can I convert it into
the nicely indented format as displayed by Internet Explorer using
Python?
Thanks,
Laguna
Input XML file (one continuous string without newline):
!-- $Revision: 12 $ -- !-- $Date: 12/13/04 5:13p $ -- control
schedule
Laguna wrote:
Hi,
I have an XML file in a single long string. How can I convert it into
the nicely indented format as displayed by Internet Explorer using
Python?
You want to pretty print. Have a look at
http://www.boddie.org.uk/python/XML_intro.html
for example.
Thank you to Paul, I've
Excellent! This is exactly what I was looking for.
Thank you Jim!
My example code:
import xml.dom.ext
import xml.dom.minidom
doc = xml.dom.minidom.parse('myfile.xml')
xml.dom.ext.PrettyPrint(doc)
--
http://mail.python.org/mailman/listinfo/python-list
I would recommend using Amara (http://uche.ogbuji.net/tech/4suite/amara/). It
works
wonders with XML.
Regards,
Michael
-- Original Message --
From: [EMAIL PROTECTED]
Reply-To: python-list@python.org
Date: Wed, 25 Jan 2006 20:55:03 +0100
Send