[Tutor] Reformatting a one (long) line xml file

Adam adam.jtm30 at gmail.com
Wed Sep 28 22:23:28 CEST 2005


BeautifulSoup <http://www.crummy.com/software/BeautifulSoup/> is a brilliant
module for this kind of thing. Just make an instance of a parser feed() in
the file with file.read() then .prettify()

On 28/09/05, Negroup - <negroup at gmail.com> wrote:
>
> Hi all, I have an xml file where the tags are all on the same line,
> without any newline. This file is quite big and difficult to read. I'd
> like to format it in a convenient way, using indentation and nesting.
> How to pretty print my content?
>
> I hope to have explained well enough my problem, differently let me know.
>
> Thans a lot!
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050928/42e1ae28/attachment.htm


More information about the Tutor mailing list