duanhanzi8328 2014-04-30 09:57
浏览 765

在服务器上加载xml文件时出错DOMDocument :: loadXML()

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>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?