I have a configuration file that has XML in it:
<Presidents> <President first="George" last="Washington" number="1" year="1789" /> <President first="John" last="Adams" number="2" year="1797" /> </Presidents>
I would like to have a pretty printer vertically align my attributes so that the file looks like this:
<Presidents> <President first="George" last="Washington" number="1" year="1789" /> <President first="John" last="Adams" number="2" year="1797" /> </Presidents>
This formatting style depends on having a list of elements with the same attributes, so it probably cannot be applied in general to any XML document, but it is common to configuration files. I have read the man pages for xmllint and xmlstarlet , and I cannot find a link to such a function.
source share