A
A
Anton2018-01-30 18:32:22
XML
Anton, 2018-01-30 18:32:22

What is wrong with xml file?

Why does the browser swear? I tried to change the quotes and it seems that the tags are all closed ...

<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE yml_catalog SYSTEM "shops.dtd">
<yml_catalog date="2018-01-30 17:40">
<shop>
<name>Магазин</name>
<company>Nest</company>
<url>http://www.test.ru</url>
<version>Выгрузка для сайта test.net</version>
<category id='124'>Основной раздел каталога</category>
<offers>
<offer>
<vendor>Silhouette</vendor>
<model>TMA Pilot</model>
<color>Черный</color>
<price>13590</price>
<url>http://www.test.ru/123/</url>
<picture>http://www.test.ru/upload/393c0.jpg</picture>
<category>Фигня</category>
</offer>
</offers>
</shop>
</yml_catalog>

Parse error: syntax error, unexpected 'version'
(T_STRING) in /home/bitrix/www/yandex/new.php on line 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-01-30
@anton99zel

Because the file extension is .php and <? assumes the beginning of the php code. Change the file extension to xml.
Or replace the first line with

<?php echo '<?xml version="1.0" encoding="windows-1251"?>' ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question