I'm trying to create a schema for a test. The test XML would look something like this:
I have this working somewhat in my schema except that I cannot use the "xs:ID" type for uniquely identifying each choice and only allowing the value of answer to be one of the IDs because the ids can occur many times but in different questions.
Is there a similar "xs:ID" type except for a narrower scope?
Code:
<document>
<test>
<question>
<content>Some content for the question goes here</content>
<choices>
<choice id="a">This is choice A.</choice>
<choice id="b">This is choice B.</choice>
<choice id="c">This is choice C.</choice>
</choices>
<answer>b</answer>
</question>
<question>
<content>Some content for the question goes here</content>
<choices>
<choice id="a">This is choice A.</choice>
<choice id="b">This is choice B.</choice>
<choice id="c">This is choice C.</choice>
</choices>
<answer>b</answer>
</question>
</test>
</document>
I have this working somewhat in my schema except that I cannot use the "xs:ID" type for uniquely identifying each choice and only allowing the value of answer to be one of the IDs because the ids can occur many times but in different questions.
Is there a similar "xs:ID" type except for a narrower scope?