Reputation: 112
I have this code
<?php
$url = "_configurations/right_sidebar_links.xml";
$xml = simplexml_load_file($url);
foreach($xml->links as $links)
{
echo "<li>";
echo "<a href='".$links->url."'>";
echo $links->name."</a></li>";
}
?>
that loads xml links from another file, it works fine with links that doesn't have any strange characters but when you enter long link with weird characters it gives an error that is saying
Warning: simplexml_load_file() [function.simplexml-load-file]: _configurations/right_sidebar_links.xml:17: parser error : EntityRef: expecting ';' in .../includes/loadLinks.php on line 8
any help would be much appreciated.
here is an example of the link
Thanks!
Upvotes: 0
Views: 11111
Reputation: 13802
The contents of your XML file are invalid. Make sure it's properly encoded (ie &
is &
) and/or CDATA
tags are used where necessary.
If you open the XML file in a modern browser, they'll usually give you a detailed answer as to where the error is (line and character).
Also, see this hack
Upvotes: 1