Subject: | XML which starts with a comment a newline after the comment is lost |
Hi, there is a bug, \n after first comment (outside xml) is lost:
$ cat bug-perl-xpath.pl
#!/usr/bin/perl
use strict;
use XML::XPath;
use XML::XPath::XMLParser;
my $xml=<<EOX;
<!-- a comment -->
<a>
</a>
EOX
my $xp = XML::XPath->new(xml => $xml);
my $xml=$xp->findnodes_as_string("/") ;
# $xml =~ s/-->(.)/-->\n$1/m;
printf "$xml\n";
$ perl bug-perl-xpath.pl
<!-- a comment --><a>
</a>
# THANKS !