xml parsing with simple xml [duplicate]
Possible Duplicate:
Problem with simpleXML and entity not being defined
I have this tag with an entity in an xml file:
<comune>Forli'</comune>
Simple xml in php fail to parse the file:
Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: parser error : Entity 'igrave' not defined
How can i do?
I tried this a small example and it worked for me
XML:
<?xml version="1.0" encoding="UTF-8"?>
<comune>
<comune>Forli'</comune>
</comune>
PHP:
$xml = simplexml_load_file('test.xml');
foreach($xml->children() as $child){
echo '<pre>';
print_r((string)$child);
echo '</pre>asd';
}
OUTPUT:
Forli'
Check this solution for help
精彩评论