You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Dane Foster <df...@equitytg.com> on 2000/11/08 20:55:13 UTC

Revison to Schema Question

For the purpose of clarity I have added some additional conditions below
----- Original Message ----- 
From: Dane Foster 
To: general@xml.apache.org 
Sent: Wednesday, November 08, 2000 1:11 PM
Subject: Schema Question


I know that most of the post to this list deal with Xerces and Xalan so this may not be the place to ask this question.  If it's not please let me know.  Anyway, my question is this, in the current Schema specification (..2000/10/XMLSchema), how do I specify that if an element contains a particular attribute it's children must be a specific element?

Example:

Notes*: The myElement node's 'type' attribute can be one of two values "type1" or "type2".  If the value is type1 then the root node(s) of the myElement sub-tree must be 'type-1-element'.  If the value is type2 then the root node(s) of the myElement sub-tree must be 'type-2-element'.

<!--Scenario one-->
<myElement type="type1">
  <type-1-element>Element data goes here</type-1-element>
</myElement>


<!--Scenario two-->
<myElement type="type2">
  <type-2-element>Element data goes here</type-2-element>
</myElement>


Scenario Three and Four are not considered a valid construct for what I'm trying to do

<!--Scenario Three.   -->
<myElement type="type1">
    <type-2-element>Element data goes here</type-2-element>
</myElement>


<!--Scenario Four -->
<myElement type="type2">
  <type-1-element>Element data goes here</type-1-element>
</myElement>




Dane Foster