Home » XML » XML_Parser » Bug #4774
XML_Parser shoud report source column number on errors
Details
| Request #4774 | XML_Parser shoud report source column number on errors |
|---|---|
| Submitted | 2005-07-09 08:22 UTC |
| From | hartmut at php dot net |
| Assigned | schst |
| Status | Closed |
| Package | XML_Parser |
| PHP Version | Irrelevant |
| OS | any |
| 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);
}
// }}}
}