2010-03-09 109 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

回答