Как игнорировать строгую последовательность элементов в DTD?

Здравствуйте, подскажите как заставить SAX-парсер не ругаться на не правильную последовательность элементов в файле.

Использую help.yandex.ru/partnermarket/yml/about-yml.xml

partner.market.yandex.ru/pages/help/shops.dtd
partner.market.yandex.ru/pages/help/YML.xml

<offer id="12342" type="book" bid="17" available="true">
<url>http://magazin.ru/product_page.asp?pid=14345</url>
<price>100</price>
...
</offer>


Стоит только поменять местами пару элементов
<offer id="12342" type="book" bid="17" available="true">
<price>100</price>
<url>http://magazin.ru/product_page.asp?pid=14345</url>
...
</offer>


и мой парсер начинает матерится...
The content of element type "offer" must match "(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*)".


Самое интересное, что если проверить измененный фид в я.маркете то он успешно проходит проверку. Как быть?

Кодъ
try {
     SAXParserFactory factory = SAXParserFactory.newInstance();
     factory.setValidating(true);
     SAXParser parser = factory.newSAXParser();
     XMLReader reader = parser.getXMLReader();
     reader.setContentHandler(this);
     reader.setErrorHandler(this);
     InputSource source = new InputSource("file.xml");
     reader.parse(source);
} finally {}
  • Вопрос задан
  • 2236 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы