I have following XML tags in a large number.
<SERVICE>
<NAME>
sh_SEET15002GetReKeyDetails
</NAME>
<ID>642</ID>
</SERVICE>
I want to get this formatted in the following manner. I have tried using xmllint but it is not working for me. Please provide help.
<SERVICE>
<NAME>sh_SEET15002GetReKeyDetails</NAME>
<ID>642</ID>
</SERVICE>
xmllint -format -recover nonformatted.xml > formated.xml
For tab indentation:
export XMLLINT_INDENT=`echo -e '\t'`
For four space indentation:
export XMLLINT_INDENT=\ \ \ \