views:

13

answers:

1

I need a command-line XML pretty-printer tool that will not overflow given output line width.

All tools I've tried (xmlstarlet, xmllint, xmlindent) overflow line width when printing tags with many attributes. I'll settle if each attribute will be printed at a separate line (while keeping indentation of course).

Tool must be free, runnable on Linux and, preferably, have an Ubuntu package. However, I'll settle for a downloadable library.

Any clues?

+1  A: 

HTML Tidy with -xml will reformat XML.

Ignacio Vazquez-Abrams
Thanks, it almost works. However I see gives incorrect indentation for the tag right after CDATA. Is it a known issue?
Alexander Gladysh