Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Schema: "xs:ID" scope?

Status
Not open for further replies.

thenewa2x

Programmer
Dec 10, 2002
349
US
I'm trying to create a schema for a test. The test XML would look something like this:

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?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top