下面是一个小模式和一个示例XML文件,如果选择XSD1.1,而不是XSD1.0,它将在上成功验证。
选择了1.0后,模式本身就会被拒绝,因为从t1派生的t1是无效的。(目的是t1允许一个可选的thing和一些stuff,而t2是一个保留stuff但禁止thing的限制。)
选择1.0的Xerces-J的确切投诉是:
[Error] foo.xsd:19:28:rcase-Recurse.1: Group's occurrence range, (0,unbounded), is not a valid restriction of base group's occurrence
我有一个包含问题结构的XML文件格式:
<question id="q101">
<text>Do you like the color red?</text>
<answer>yes</answer>
<answer>no</answer>
</question>
<question id="q102">
<text>What is your favorite color?</text>
<answer&