[ expat-Bugs-2020141 ] Characters lost during parsing

"SourceForge.net" <[email protected]> Thu, 17 Jul 2008 01:22:10 +0000
Newsgroups gmane.text.xml.expat.bugs
Message-ID <[email protected]>
Bugs item #2020141, was opened at 2008-07-16 21:22
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=2020141&group_id=10127

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Andrew D. Arenson (arenson9)
Assigned to: Nobody/Anonymous (nobody)
Summary: Characters lost during parsing

Initial Comment:
Characters can be lost during parsing.

I'm going to attach a file. My example file is too big to be included through this interface, so I've made it available at:

http://miniscd.uits.iupui.edu/aarenson/example6.xml

I put the Perl program I used to demonstrate the error as an attachment on this submission, but here it is as well:

#!/usr/bin/perl -w
use XML::Parser;
my $XmlFile = shift @ARGV;
my $xp = new XML::Parser(Handlers => {Start => \&start,
                                      End   => \&end,
                                      Char  => \&cdata});
$xp->parsefile($XmlFile);

sub start { $curTag = lc($_[1]); }

sub end { $curTag = ""; }

sub cdata {
    my ($xp,$data) = @_;

    if ($curTag eq "globalid") { $ID = $data; }

    if ($data eq ".5") {
        print "ID: $ID; TAG: $curTag\n";
    }
}


When I use the above program on the example XML file, the last value in the XML file, '52.5', gets parsed as just '.5'.


I wonder if this is related to something that was reported twelve months ago on the XML::Parser bug list at:

   http://rt.cpan.org/Public/Bug/Display.html?id=28585

That bug report on the XML::Parser bug list has not been opened. It is still listed as New.

I'm sorry I don't know the version number of Expat that I'm using or how to determine it.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=2020141&group_id=10127