Reading XML like Python!

Roy Smith roy at panix.com
Sun Oct 24 22:43:08 EDT 2004


In article <ba129ce7.0410241810.5c60a534 at posting.google.com>,
 johng2001 at rediffmail.com (John) wrote:

> I have to read a lot of XML for my upcoming project.
> XML is hard on my eyes.
> Is there some sort of converter that converts XML to something more
> eye friendly? maybe like Python? I have seen restructured text. There
> is a paper at EuroPython 2004 that seems to do something similar.
> 
> "Pythonic Alternatives for declarative XML-based specifications of
> robot behavior"
> 
> Anyone know of any tools along these lines?
> 
> Thanks.

I had the same problem recently.  I used the standard xml.dom.minidom 
module to parse the XML, and about a page of Python code to pretty-print 
it.  Unfortunately, I'm not able to release the code, but if you're 
familiar with how DOM works, you should be able to replicate it in under 
an hour.  If you're not familiar with DOM, it'll take you longer, but 
it'll also give you a chance to get familiar :-)

Have you tried DAGS for "xml pretty-print"?



More information about the Python-list mailing list