Strip XML comments with sed
Posted Sun, 14 Jan 2007
sed -ne '/<!--/ { :c; /-->/! { N; b c; }; /-->/s/<!--.*-->//g }; /^ *$/!p;'
You might consider stripping blanklines and/or filtering through xmllint
--format to make the xml pretty printed.
sed -ne '/<!--/ { :c; /-->/! { N; b c; }; /-->/s/<!--.*-->//g }; /^ *$/!p;'
You might consider stripping blanklines and/or filtering through xmllint
--format to make the xml pretty printed.