|
|
|
| Пытаюсь поработать с XML, но наткнулся на ошибки.
======================================================
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 1: parser error : Start tag expected, '<' not found in Z:\home\auto4\www\autosalon.php on line 58
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: files/77813654114821718.xml in Z:\home\auto4\www\autosalon.php on line 58
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in Z:\home\auto4\www\autosalon.php on line 58
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in Z:\home\auto4\www\autosalon.php:58 Stack trace: #0 Z:\home\auto4\www\autosalon.php(58): SimpleXMLElement->__construct('files/778136541...') #1 {main} thrown in Z:\home\auto4\www\autosalon.php on line 58
======================================================
58: $import = new SimpleXMLElement($filename);
Сам файл XML
<?xml version='1.0' standalone='yes'?>
<export version="2.0">
<offers>
<offer>
<marka>ВАЗ</marka>
<model>Калина</model>
<year>2011</year>
</offer>
<offer>
<marka>УАЗ</marka>
<model>Патриот</model>
<year>2005</year>
</offer>
</offers>
</export> | |
|
|
|
|
|
|
|
для: zsaz
(08.04.2013 в 13:01)
| | Первый параметр конструктора SimpleXMLElement принимает на вход данные, а не путь к файлу. Если уж передаете путь, то обратите внимание на третий параметр конструктора. | |
|
|
|