PHP Bug/Error with XML Parsing Syntax??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux