Skip Menu |
 

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 32510
Status: resolved
Priority: 0/
Queue: XML-LibXML

People
Owner: Nobody in particular
Requestors: evdb [...] ecclestoad.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: $node->line_number stops incrementing at 65535
Date: Tue, 22 Jan 2008 11:07:50 +0000
To: bug-XML-LibXML [...] rt.cpan.org
From: "Edmund von der Burg" <evdb [...] ecclestoad.co.uk>
Download (untitled) / with headers
text/plain 1.5k
Hello, I'm using XML::LibXML to handle very large XML files - up to 700,000 lines. When trying to report the line numbers that errors occur at I'm finding that the line numbers max out at 65535. This code shows the problem for me. use strict; use warnings; use XML::LibXML; use Test::More 'no_plan'; diag "XML::LibXML::VERSION: $XML::LibXML::VERSION"; my $xml = "<?xml version=\"1.0\"?>\n"; $xml .= "<outer>\n"; $xml .= " <inner_$_>$_</inner_$_>\n" for 3 .. 100_000; $xml .= "</outer>\n"; my $parser = XML::LibXML->new; $parser->line_numbers(1); my $doc = $parser->parse_string($xml); foreach my $line ( 10, 1000, 65534, 65535, 65536, 100_000 ) { my ($node) = $doc->findnodes(".//inner_$line"); is $node->line_number, $line, "checking line number $line"; } Which gives me the following output: # XML::LibXML::VERSION: 1.65 ok 1 - checking line number 10 ok 2 - checking line number 1000 ok 3 - checking line number 65534 ok 4 - checking line number 65535 not ok 5 - checking line number 65536 # Failed test 'checking line number 65536' # in lib-xml-line-number-glitch.pl at line 19. # got: '65535' # expected: '65536' not ok 6 - checking line number 100000 # Failed test 'checking line number 100000' # in lib-xml-line-number-glitch.pl at line 19. # got: '65535' # expected: '100000' 1..6 # Looks like you failed 2 tests of 6. Please let me know if there is anything else I can do to help fix this glitch. Cheers, Edmund. -- In reality I'm evdb@ecclestoad.co.uk - http://ecclestoad.co.uk Drive in the UK? - sign this: http://petitions.pm.gov.uk/displaythespeed/
Download (untitled) / with headers
text/plain 444b
Yes, this is unfortunately a limitation of libxml2 that its developer is clearly unwilling to fix:-( See http://bugzilla.gnome.org/show_bug.cgi?id=325533 The only thing you may do is try to fight for a fix there, since this is not fixable in the Perl wrapper. I'm really sorry (and please believe me I'm myself also truly annoyed by this limitation), but so far I can't do anything better about this ticket than postpone it. -- Petr
Subject: Re: [rt.cpan.org #32510] $node->line_number stops incrementing at 65535
Date: Thu, 24 Jan 2008 13:03:17 +0000
To: bug-XML-LibXML [...] rt.cpan.org
From: "Edmund von der Burg" <evdb [...] ecclestoad.co.uk>
Download (untitled) / with headers
text/plain 947b
On 24/01/2008, Petr Pajas via RT <bug-XML-LibXML@rt.cpan.org> wrote: Show quoted text
> Yes, this is unfortunately a limitation of libxml2 that its developer > is clearly unwilling to fix:-(
Hmm - I don't think I want to get involved in that bun fight :) Show quoted text
> I'm really sorry (and please believe me I'm myself also truly annoyed > by this limitation), but so far I can't do anything better about this > ticket than postpone it.
I agree - this is an upstream issue - all I can suggest is that you add a note in the pod for the line_number method that says something like: Due to limitations in the libxml2 library line numbers greater than 65535 will be returned as 65535. Please see http://bugzilla.gnome.org/show_bug.cgi?id=325533 for more details. Then at least the behaviour is documented and people who have issues know where to go to try and get it fixed. Thanks for looking at it. Cheers, Edmund. -- evdb@ecclestoad.co.uk - http://ecclestoad.co.uk
Download (untitled) / with headers
text/plain 352b
Show quoted text
> I agree - this is an upstream issue - all I can suggest is that you > add a note in the pod for the line_number method that says something > like: > > Due to limitations in the libxml2 library line numbers greater than > 65535 will be returned as 65535. Please see > http://bugzilla.gnome.org/show_bug.cgi?id=325533 for more details.
Done, thanks.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.