
As discussed in our call today, I looked into the XML Schema schema (no typo) to figure out whether we can reuse a good schema constraint to represent template constraints not only pertaining to simple types.
From my point of view, we have two choices:
<xs:group name="typeDefParticle"> <xs:annotation> <xs:documentation> 'complexType' uses this</xs:documentation></xs:annotation> <xs:choice> <xs:element name="group" type="xs:groupRef"/> <xs:element ref="xs:all"/> <xs:element ref="xs:choice"/> <xs:element ref="xs:sequence"/> </xs:choice> </xs:group> <xs:group name="nestedParticle"> <xs:choice> <xs:element name="element" type="xs:localElement"/> <xs:element name="group" type="xs:groupRef"/> <xs:element ref="xs:choice"/> <xs:element ref="xs:sequence"/> <xs:element ref="xs:any"/> </xs:choice> </xs:group> typeDefParticle asks for all, choice and sequence, plus group as the top-level element. nestedParticle allows us to define a element straight away - and its type. The types localElement or topLevelElement would just allow to define an element, which could be good enough. In case we want high flexibilty, let's take nestedParticle, otherwise topLevelElement. It would be alternative to the simpleRestrictions we already have. Opinions? Heiko ----- Heiko Ludwig, Dr. rer. pol. IBM TJ Watson Research Center, PO Box 704, Yorktown, NY, 10598 hludwig@us.ibm.com, tel. +1 914 784 7160, mob. +1 646 675 8469 http://www.research.ibm.com/people/h/hludwig/