The options --pf (preserve original formatting) and --ps (preserve non-significant spaces) only work partially.
Any tag which has line breaks between attributes is collapsed on a single line.
See example before and after.
xmlstarlet ed --pf --ps -u "/server/mbean/@code" -v org.mobicents.servlet.sip.startup.jboss.JBossSip before.xml >after.xml
Log in to post a comment.