|
Posted by "Scott Fletcher" on 06/13/05 20:21
I'm not sure what's wrong with PHP.. I ran the XML file through the Mozilla
and it validate just fine. I get XML parse error but it gave no reason for
the errors.
The source code here is
[code]
$data = "<Message>Were changing</Message>";
$xml_parser = xml_parser_create('ISO-8859-1');
xml_parser_set_option($xml_parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($xml_parser, trim($data), $vals, $index);
if (xml_error_string($xml_parser)) {
echo "<br>";
echo "XML error in given source on <br>";
echo "Line: ".xml_get_current_line_number($xml_parser)."<br>";
echo "Column: ".xml_get_current_column_number($xml_parser)."<br>";
echo "Reason: ".xml_error_string(xml_get_error_code($xml_parser))."<br>";
echo "<br>";
echo "XML Data: ".$data;
echo "<br>";
}
xml_parser_free($xml_parser);
[/code]
The Error output is ...
[code]
XML error in given source on
Line: 1
Column: 32
Reason: <Message>Were changing</Message>
[/code]
Anyone know?? I'm using PHP version 4.3.2 .... Thanks....
Navigation:
[Reply to this message]
|