Sébastien de Mapias wrote:
Quote:
Shouldn't it be more clear-cut and legible to do something
like (and get rid of these attribute groups as well maybe ?):
~ <xs:complexType name="segment">
~ <xs:key name="segment-id"/>
~ <xs:sequence>
~ <xs:element name="segment-info" type="segment-info"/>
~ <xs:element name="price" type="price" minOccurs="0"/>
~ <xs:element name="ticket-ref" minOccurs="0">
~ <xs:keyref name="ticket-id-ref" ref="ticket-id"/>
~ </xs:element>
~ </xs:sequence>
~ </xs:complexType>
~
~ <xs:complexType name="ticket">
~ <xs:key name="ticket-id"/>
~ <xs:sequence>
~ <xs:element name="price" type="price" minOccurs="0">
~ </xs:element>
~ [...]
~ </xs:sequence>
~ </xs:complexType>
|
You need four definitions, one for the element or attribute which is an
id or key, one for the element or attribute which is an id reference or
key reference, one for defining the key with xs:key, and the last for
defining the key reference with xs:keyref. See
http://www.w3.org/TR/xmlschema-0/#sp...ysAndtheirRefs
--
Martin Honnen
http://JavaScript.FAQTs.com/