|
Posted by Joshua Beall on 11/11/07 02:05
Hi All,
Consider the following test code:
$xml = "<DATA></DATA>";
$parser = xml_parser_create();
$result = xml_parse($parser,$xml);
$errorcode = xml_get_error_code($parser);
$errormsg = xml_error_string($errorcode);
$ln = xml_get_current_line_number($parser);
$cn = xml_get_current_column_number($parser);
var_dump($result);
echo "Error parsing XML document, '$errormsg' : Line $ln, Column $cn";
This will output:
int(0)
Error parsing XML document, 'Invalid character' : Line 1, Column 12
A return code of int(0) indicates failure. If you replace  with
 , it works with no error.
I don't understand why it's failing on  -- isn't it perfectly
valid to include that numeric entity in the text content of an XML
node? Is this a bug? Or am I doing something wrong?
[Back to original message]
|