XML beautifier?

Alexander Staubo earlybird at mop.no
Thu Sep 2 13:47:13 EDT 1999


In article <19990902191223.A29226 at sz-sb.de>, ajung at sz-sb.de says...
> On Thu, Sep 02, 1999 at 05:29:40PM +0200, Alexander Staubo wrote:
> > I'm having a gas with the XML package and its DOM classes, but its toxml
> > () mechanism outputs mainly flat XML -- no visual structure in the form 
> > of line shifts or indentation. Is there a Python module that such 
> > beautification reasonably hassle-free?
> 
> Here is just a very stupid program which does the job. 

You're right. That was moronic. :)

>It works
> with regular expressions. You can although use the sgmllib
> to parse the file, find the tags with the unknown_starttag() and
> unknown_endtag() functions and indent the output corresponding.

Thanks for the pointer, I'll check it out. Any examples of this though? 
This is one module I have to say I have never touched.

> Cheers,
> Andreas
> ------------
[silly code elided]

-- 
Alexander Staubo             http://www.mop.no/~alex/
"`Ford, you're turning into a penguin. Stop it.'"
--Douglas Adams, _The Hitchhiker's Guide to the Galaxy_




More information about the Python-list mailing list