XML Pretty Print functionality
Posted: Wed Mar 03, 2004 3:13 pm
Folks,
Dealing with a lot of XML files lately, I've often longed for a function in TextPad that would allow me to "pretty print" (or rather: pretty format) a messed-up XML file.
E.g. I'd love to see a function in TextPad that would take an XML file, make sure to put all new elements onto a line of their own, add the perfect indenting to the XML stream, and so forth...
Turn <xml..><root><elem id="1"><subelem sid="2">..</subelem></elem></root>
into
<xml.....>
<root>
<elem id="1">
<subelem sid="2">......</subelem>
</elem>
</root>
or something like that. It'd be nice if I could specify
a) the indentation per "hiearchy level" (e.g. one tab, 2 spaces etc.)
b) whether or not to put a closing </tag> onto the same line or a separate one
With XML being widely used and adopted, I think a lot of folks could benefit from something like this
Dealing with a lot of XML files lately, I've often longed for a function in TextPad that would allow me to "pretty print" (or rather: pretty format) a messed-up XML file.
E.g. I'd love to see a function in TextPad that would take an XML file, make sure to put all new elements onto a line of their own, add the perfect indenting to the XML stream, and so forth...
Turn <xml..><root><elem id="1"><subelem sid="2">..</subelem></elem></root>
into
<xml.....>
<root>
<elem id="1">
<subelem sid="2">......</subelem>
</elem>
</root>
or something like that. It'd be nice if I could specify
a) the indentation per "hiearchy level" (e.g. one tab, 2 spaces etc.)
b) whether or not to put a closing </tag> onto the same line or a separate one
With XML being widely used and adopted, I think a lot of folks could benefit from something like this