Subject: | repair single-digit low ascii  |
Date: | Sat, 29 May 2010 08:49:29 +1000 |
To: | bug-XML-Liberal [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With XML::Liberal 0.22 and recent debian i386 perl 5.10.1 the program
foo.pl below gets an error
Can't find low ascii bytes at /usr/share/perl5/XML/Liberal.pm line 74
:1: parser error : xmlParseCharRef: invalid xmlChar value 8
<foo></foo>
^
where I hoped XML::Liberal could repair this  the same way that it
can repair a two-digit form like 
I think a single digit hex is allowed in xml, eg. 	 for a tab, it's
just the value 8 for a backspace is bad.
When run as "perl -w foo.pl" the program also gets a warning
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/XML/Liberal/Remedy/LowAsciiChars.pm line 15.
but perhaps that's a separate problem.
I struck this in a recent http://search.cpan.org/uploads.rdf where a
dodgy backspace in the pod of Xymon::Client 0.01 worked its way through
to the feed xml.
#!/usr/bin/perl -w
use strict;
use warnings;
use XML::Liberal;
print "XML::Liberal ", XML::Liberal->VERSION, "\n";
my $parser = XML::Liberal->new('LibXML');
my $doc = $parser->parse_string('<foo></foo>');
print "$doc\n";