Title: Message
This is more of a general Schema question, but what you probably want to do is use the key/keyref mechanism, see http://www.w3.org/TR/xmlschema-0/#specifyingKeysAndtheirRefs . That of course would work only if every rule has a name and all rule names are unique.
 
You won't be able to use restriction for this, since restriction has no way of constraining the contents of the restricted type "dynamically" based on values from the instance documents.
 
Radu
-----Original Message-----
From: Joe Favero [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 13, 2005 11:50 AM
To: [email protected]
Subject: XSD Question

I am trying to setup a  schema that has some restrictions.

The first section of the schema has rules

<rules>
  <rule>
     <name>rule1</name>
     <data> …</data>
  </rule>
  <rule>
     <name>rule2</name>
     <data>….</data>
  </rule>
</rules>

Now the question … I have another section that references these rules.
How do I define the restriction so that elements in this section can
only reference rules that exist??

<calendars>
  <calendar>
    <name>calendar1</name>
    <rules>
       <rule>rule1</rule>
    <rules>
  </calendar>

</calendars>


Joseph Favero
President, Obsidian Solutions, Inc.
tel 1.303.741-4893
cell 1.303.522.4663

[EMAIL PROTECTED]
http://www.obsidiansoln.com

  • XSD Question Joe Favero
    • RE: XSD Question Radu Preotiuc-Pietro

Reply via email to