I have a problem with loading xml file on http server (on localhost -windows - everything works fine). When I trying run script to update instock products (prestashop store) from xml file I getting this error:
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Start tag expected, '<' not found in Entity, line: 1 in /home/fi164048/public_html/import/magazyn2.php on line 35
To download and load xml file I using this function:
$xmlfile = 'import/'.time().'.xml';
$xml = file_get_contents("http://urladreeess.pl/ShowXml.ashx?id=3");
$download = file_put_contents($xmlfile, $xml);
if($download){
echo "Success!<br>";
} else { echo "Fail!<br>"; }
$oDOM = new DOMDocument();
$oDOM->loadXML($xmlfile);
File is correctly creating in import directory. When I tried to change loadXML
to load
function I'm getting 500 Internal Server Error
.
Any sugestion how can I load this xml file? I will be grateful for any suggestion.
Ps. sorry for my bad english
XML FILE STRUCTURE:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE nokaut SYSTEM "http://www.nokaut.pl/integracja/nokaut.dtd"><nokaut generator="Comarch ERP e-Sklep" ver="7.2"><offers><offer><id>5</id><name>ANTENKI DO SIATKÓWKI /2szt/</name><description>Antenka do siatkówki. </description><price>21.22</price><weight>1.000</weight><category>Sport i hobby / Sporty drużynowe / Siatkówka</category><instock>51</instock></offer>