http://qs1969.pair.com?node_id=430404


in reply to Formatting in XML::Twig->print()

Why not prettifying in a post-processing step?

I mean, if you happen to have libxml2 installed, then you have the unbeatible xmllint utility at your disposal:

rg@something:/tmp$ echo '<PrimaryServers><Server Name="New_2"/><Server + Name="New_1"/></PrimaryServers>' | xmllint --format -
This results in a beautiful XML layout:
<?xml version="1.0"?> <PrimaryServers> <Server Name="New_2"/> <Server Name="New_1"/> </PrimaryServers>

rg0now