DSam has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have a big XML file of size 600MB, while validating, if error occurs in a line more than 65535, its printing the line Number as 65535, I am using XML::LibXML for validation. Please help. The script is in Windows environment.
Please let me know, if any other CPAN is available which can print the line numbers.

Please find below code:
sub validateXML { my ($xmlfile, $xsdfile) = @_; my $parser = XML::LibXML->new (XML_LIBXML_LINENUMBERS => 1 ); my $doc = $parser->parse_file ("$xmlfile"); my $schema = XML::LibXML::Schema->new( location => "$xsdfile" ); eval { $schema->validate($doc) }; return $@; }

Replies are listed 'Best First'.
Re: XML Validation NOT printing the correct line number beyond 65535
by Mr. Muskrat (Canon) on Aug 12, 2016 at 18:17 UTC
Re: XML Validation NOT printing the correct line number beyond 65535
by hippo (Archbishop) on Aug 12, 2016 at 13:55 UTC

    Welcome to the Monastery, brother DSam.

    It is customary around here to illustrate any problems you might have with some code so that others might replicate the problem and/or point out where you are going wrong. A Short, Self Contained, Correct (Compilable) Example or "SSCCE" is usually recommended. If you can provide that it would help us to help you enormously.

Re: XML Validation NOT printing the correct line number beyond 65535
by ww (Archbishop) on Aug 12, 2016 at 14:41 UTC

    2^16 limit/problem in XML::LibXML?

    And, as hippo noted... see sig!

    ++$anecdote ne $data

Re: XML Validation NOT printing the correct line number beyond 65535
by tthurheimer (Initiate) on Dec 15, 2016 at 15:29 UTC
    DSam - Just wondering if you ultimately came upon any solution or workaround for this. I am struggling with an identical problem.

      Did you apply the patch from the bug report which Mr. Muskrat found?