Okay, so I finished the w3schools tutorial on XML Schema, and I still have a question about something. I'm trying to do something like type inheritance. I think a quick example would demonstrate this well:
Code:
<scope>
<var_decl/>
<var_decl/>
<conditional />
<loop />
</scope>
The idea is that scope should be able to contain an ordered list of statements, where a var_decl is a statement, a condition is a statement, and a loop is a statement.
Relevant XSD snippets of my current attempts are included below:
Code:
<xs:complexType name="statement">
<xs:choice>
<xs:element ref="var_decl"/>
<xs:element ref="conditional"/>
<xs:element ref="loop"/>
</xs:choice>
</xs:complexType>
But this doesn't really do what I want. This defines the type 'statement' to be an element that contains a var_decl, conditional, or loop. I want it to define a type that IS either a var_decl, conditional, or loop.
Any ideas?