Ok I am getting this wierd error when trying to parse a XML file that is correctly formatted no errors.
when using
simplexml_load_file($file)
and
$file = the relative path to the xml file say
$file = 'xml/myfile.xml';
This will load and parse the file fine
but when i try to use the absolute path
$file = 'http://localhost/schoolsite/xml/myfile.xml';
I receive an error
myfile.xml:1: parser error : Document is empty
myfile.xml:1: parser error : Start tag expected, '<' not found
Warning: ^ in
and I have echoed out $file and it is the correct path i can paste it in my browser and go strait to it, yet it wont load using simplexml ....
so i started messing with the xml file making sure it wasn't misformed and i was left with
<?xml version="1.0" encoding="iso-8859-1"?>
<menus>
<menu name="header" style="0" published="1">
<category name="schools" published="1" display="0">
<item url="#" tag="lang::en">home</item>
</category>
</menu>
</menus>
and when i leave the file like this is will load using the absolute path so i added the items again ...
<?xml version="1.0" encoding="iso-8859-1"?>
<menus>
<menu name="header" style="0" published="1">
<category name="schools" published="1" display="0">
<item url="#" tag="lang::en">home</item>
<item url="#" tag="id::two">high school</item>
<item url="#" tag="id::three">junior high</item>
<item url="#" tag="id::four">intermediate school</item>
<item url="#" tag="id::five">elementary school</item>
</category>
</menu>
</menus>
and i receive the errors again when using the absolute path, but if i use the relative path it is fine .. any ideas on this one?