xml pasing problems
Posted: Wed Sep 19, 2007 11:18 pm
Hi,
For a while now i started working with php, but have run into a big problem.
we communicate from windows to php trhough some scripts an i pass a xml document to a php page for processing
but as soon as there are any special char like the english pound sign or ascci code 215
the following code fails
It is unable to parse the xml as for the microsoft msxml parser who created the xml there is no problem
aso the code gives me a error
<br />
<b>Warning</b>: feof(): supplied argument is not a valid stream resource in <b>D:\websites\HomeOrderTest\xml_parser.php</b> on line <b>169</b><br />
anyone has an idea why this is failing
For a while now i started working with php, but have run into a big problem.
we communicate from windows to php trhough some scripts an i pass a xml document to a php page for processing
but as soon as there are any special char like the english pound sign or ascci code 215
the following code fails
Code: Select all
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startTag", "endTag");
xml_set_character_data_handler($xml_parser, "contents");
if(!(xml_parse($xml_parser, $data, feof($fp)))){
die(error_base_xml(20000,"could not parse the xml structure","Error on line " . xml_get_current_line_number($xml_parser)));aso the code gives me a error
<br />
<b>Warning</b>: feof(): supplied argument is not a valid stream resource in <b>D:\websites\HomeOrderTest\xml_parser.php</b> on line <b>169</b><br />
anyone has an idea why this is failing