2010-03-09 111 views
3

我正在嘗試使用xmllint來驗證模式,我相信它使用下面的libxml2庫。對大型模式文件進行xml模式驗證

問題是我有一個非常大的模式文件大約10MB。當我這樣做:

xmllint --schema j9.xsd --noout jsample.xml 

我得到了以下錯誤:

j9.xsd:65535: element annotation: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))). 
j9.xsd:65535: element annotation: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))). 

..... 這正好和。顯然錯誤的行數不應該是65535,如果有錯誤。我想知道是否有另一個庫沒有這個限制,或者如果有人知道如何解決這個錯誤。謝謝!

+0

做了補丁提到的Chaim爲你工作? – Bhushan 2012-02-24 00:47:23

+0

補丁工作正常。我不知道他們寫了哪個版本,所以我手動修補libxml版本2.7.6,現在得到錯誤行的正確行號。 – 2012-08-19 11:03:10

回答