Difference between revisions of "XML"
Jump to navigation
Jump to search
(Created page with "Generic remarks about XML. Comments start with '<!--' and end with '-->'. Comments cannot be nested. Regular expressions to remove comments (Perl code) <syntaxhighlight lang...") |
(No difference)
|
Revision as of 12:51, 19 March 2018
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 = '';
}