XML
Jump to navigation
Jump to search
Generic remarks about XML.
Comments start with . Comments cannot be nested.
Regular expressions to remove comments (Perl code)
#If comment-end is found remove comment-part.
# comment-start may be on the same line.
if ( $line =~ /(\<\!--)?.*--\>/ ) {
$comment = 0;
$line =~ s/$&//;
# If there is only a comment-start, clear line until comment-end is found
} elsif ( $line =~ /\<\!--/ ) {
$comment = 1;
$line =~ s/\<\!--.*$//;
}
if ( $comment ) {
$line = '';
}