大型模式文件的xml架构验证

时间:2010-03-09 16:50:04

标签: xsd

我正在尝试使用xmllint来验证架构,我相信它使用下面的libxml2库。

问题是我有一个大约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。我想知道是否有其他库没有此限制,或者如果有人知道如何修复此错误。谢谢!

1 个答案:

答案 0 :(得分:2)

libxml2的WONTFIX错误。 https://bugzilla.gnome.org/show_bug.cgi?id=325533。非官方补丁附加到bug报告,尚未尝试过...