A
A
Arseniy2015-05-15 07:37:52
Yandex
Arseniy, 2015-05-15 07:37:52

Why is the simplest yml document not validated according to the dtd schema?

I ask for your help. There is a simple description of the Yandex Market product (only required fields are indicated)

<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE yml_catalog SYSTEM "shops.dtd">
<yml_catalog date="2010-04-01 17:00">
<shop>
    <name>Magazin</name>
    <company>Magazin</company>
    <url>http://www.magazin.ru/</url>
    <currencies>
    <currency id="RUR" rate="1" plus="0"/>
    </currencies>
    <categories>
    <category id="1">Часы</category>
    </categories>
    <local_delivery_cost>300</local_delivery_cost>
    <offers>
        <offer id="12346" available="true" bid="21">
            <price>600</price>
            <currencyId>RUR</currencyId>
            <categoryId>1</categoryId>
            <name>Наручные часы Casio A1234567B</name>
        </offer>
    </offers>
</shop>
</yml_catalog>

Here is the part of the dtd schema that is responsible for validating the offer tag:
<!ELEMENT offer 
(
  url?, buyurl?, price, wprice?, currencyId, xCategory?, categoryId+, market_category?, picture*, store?, pickup?, delivery?, deliveryIncluded?, local_delivery_cost?, orderingTime?,
  (
    (typePrefix?, vendor, vendorCode?, model, (provider, tarifplan?)?) |
    (author?, name, publisher?, series?, year?, ISBN?, volume?, part?, language?, binding?, page_extent?, table_of_contents?) |
    (author?, name, publisher?, series?, year?, ISBN?, volume?, part?, language?, table_of_contents?, performed_by?, performance_type?, storage?, format?, recording_length?) |
    (artist?, title, year?, media?, starring?, director?, originalName?, country?) |
    (worldRegion?, country?, region?, days, dataTour*, name, hotel_stars?, room?, meal?, included, transport, price_min?, price_max?, options?) |
    (name, place, hall?, hall_part?, date, is_premiere?, is_kids?) |
    (name, vendor?, vendorCode?)
  ),
  aliases?, additional*, description?, sales_notes?, promo?, manufacturer_warranty?, country_of_origin?, downloadable?, adult?, age?, barcode*, param*, related_offer*
)>

I'm trying to validate this document using the xmllint utility:
xmllint --valid --noout ~/XML/test321.yml
I get the following error:
Content model of offer is not determinist.
Maybe you'll notice something wrong with the document, that it can't pass validation. If you don’t believe me, you can download shop.dtd from Yandex and try to validate them, supposedly a valid example. It didn't work for me (:
Many thanks in advance for any attempt to help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question