I'm sure someone's going to pipe up with one of the XML::* modules that I don't recall offhand but you could use xmllint (which most expat or xmllib installs should come with) and it's --format option to get at least started.
$ xmllint --format --pretty 1 sample_txt.xml <?xml version="1.0" encoding="ISO-8859-1"?> <root> <para> <pnum>1</pnum> <ptext>This is a sample of a very specific text <emph>called</emph +> <term>description</term> which has 2 subtypes: <list><item><term>1. +</term><p>precise</p></item><item><term>2.</term><p>fuzzy</p></item>< +/list></ptext> </para> </root>
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: Indent XML data
by Fletch
in thread Indent XML data
by LexPl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |