Strip comments from an XML file

Posted on Sat 18 October 2014 in misc

Ever had an xml file bloated with comments? Here's a great one-liner for striping them.

tidy -quiet -asxml -xml -indent -wrap 1024 --hide-comments 1 file.xml

Thanks to http://stackoverflow.com/questions/1464697/stripout-comments-from-xml