Bug #72550 [Opn->Fbk]: xml_get_current_line_number gives wrong numbers. col too?

From: Date: Wed, 06 Jul 2016 13:10:54 +0000
Subject: Bug #72550 [Opn->Fbk]: xml_get_current_line_number gives wrong numbers. col too?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202096@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72550&edit=1 ID: 72550 Updated by: cmb@php.net Reported by: jim dot michaels at Jesusnjim dot com Summary: xml_get_current_line_number gives wrong numbers. col too? -Status: Open +Status: Feedback Type: Bug Package: XML related Operating System: vista 32 amd64 PHP Version: 7.1.0alpha1 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: > don't have a small test script. The supplied test script is small enough, but not self-contained. Please provide either another script that generates the XML, or provide the XML for download. Previous Comments: ------------------------------------------------------------------------ [2016-07-06 00:22:21] jim dot michaels at Jesusnjim dot com Description: ------------ ./menu7a.xml: 4576:1, ERROR:No error (error may be on previous line) don't have a small test script. this error is past end of file, which is line 4568. Test script: --------------- $contents = @file_get_contents($xmlFile);//for tag content replacement $xmlArray=array(); $tags=array(); global $AcctTypes,$TagTypes,$rootTag; //this is the list of $parser = xml_parser_create_ns('utf-8',':'); // WORKS JUST FINE $xmlSuccess=xml_parse_into_struct($parser, $contents, $xmlArray, $tags); if (XML_ERROR_NONE!=xml_get_error_code($parser) || $xmlSuccess) { echo "-------------------------XML ERROR-------------------------\r\n". "-------------------------XML ERROR-------------------------\r\n". "-------------------------XML ERROR-------------------------\r\n". $xmlFile.': '.xml_get_current_line_number($parser).':'. xml_get_current_column_number($parser).', ERROR:'. xml_error_string(xml_get_error_code($parser)). " (error may be on previous line)\r\n". "-------------------------XML ERROR-------------------------\r\n". "-------------------------XML ERROR-------------------------\r\n". "-------------------------XML ERROR-------------------------\r\n"; xml_parser_free($parser); exit(1); } xml_parser_free($parser); Expected result: ---------------- line number matching the problem. someone put random number generator in the parser/lexer? Actual result: -------------- ./menu7a.xml: 4576:1, ERROR:No error (error may be on previous line) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72550&edit=1

« previous php.bugs (#202096) next »