Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - How do you best express references to keys/ID's in an XSD ? >Thread Next - Re: How do you best express references to keys/ID's in an XSD ? Re: How do you best express references to keys/ID's in an XSD ?To: NULL Date: 10/1/2008 12:33:00 PM Sébastien de Mapias wrote: > 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/#specifyingKeysAndtheirRefs -- Martin Honnen http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
