我有驗證XML文件對一個XSD架構與xmllint
問題空標籤:xmllint孔潘與有效性的錯誤,像<foobar/>
標籤預計不會盡管foobar
定義在XSD模式是這樣的:XML模式驗證xmllint:抱怨像<foobar/>
<xs:element name="foobar" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="9999"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
對於比較:
<foobar>123</foobar>
根據xmllint是有效的。 xmllint也不會抱怨,如果我從XML文件中完全剝離標籤foobar
。
問:
那麼,什麼是否認<foobar/>
點?
謝謝!
P.S .:實際的錯誤消息:
myfile.xml:135298: element foobar: Schemas validity error : Element '{http://www.foobaz.com/namespace}foobar': '' is not a valid value of the local atomic type.
P.P.S .: xmllint版本20901倍