PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » XML » XML_Parser » Bug #4774

XML_Parser shoud report source column number on errors

Details

Request #4774XML_Parser shoud report source column number on errors
Submitted2005-07-09 08:22 UTC
Fromhartmut at php dot net
Assignedschst
StatusClosed
PackageXML_Parser
PHP VersionIrrelevant
OSany
Roadmaps(Not assigned)

Comments

[2005-07-09 08:22 UTC] hartmut at php dot net

Description:
------------
Error messages produced by XML_Parser should not only show the line number but also the column position within that line

(especially as some XML generating tools seem to hate newlines, producing output that is stuffed into a loooooong single line)

Reproduce code:
---------------
diff -u -r1.25 Parser.php
--- Parser.php 25 Mar 2005 17:13:10 -0000 1.25
+++ Parser.php 9 Jul 2005 08:21:10 -0000
@@ -673,12 +673,14 @@
{
if (is_resource($msgorparser)) {
$code = xml_get_error_code($msgorparser);
- $msgorparser = sprintf('%s at XML input line %d',
+ $msgorparser = sprintf('%s at XML input line %d:%d',
xml_error_string($code),
- xml_get_current_line_number($msgorparser));
+ xml_get_current_line_number($msgorparser),
+ xml_get_current_column_number($msgorparser));
}
$this->PEAR_Error($msgorparser, $code, $mode, $level);
}
// }}}
}