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

From: Date: Sun, 17 Jul 2016 04:22:23 +0000
Subject: Bug #72550 [Fbk->NoF]: xml_get_current_line_number gives wrong numbers. col too?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202368@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:       php-bugs@lists.php.net
 Reported by:      jim dot michaels at Jesusnjim dot com
 Summary:          xml_get_current_line_number gives wrong numbers. col
                   too?
-Status:           Feedback
+Status:           No Feedback
 Type:             Bug
 Package:          XML related
 Operating System: vista 32 amd64
 PHP Version:      7.1.0alpha1
 Assigned To:      cmb
 Private report:   N

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.


Previous Comments:
------------------------------------------------------------------------
[2016-07-06 13:10:52] cmb@php.net

> 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.

------------------------------------------------------------------------
[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


Thread (3 messages)

« previous php.bugs (#202368) next »