W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2000

Multi-field key

From: Ani Pedersen <APeders@plexus.ca>
Date: Tue, 11 Apr 2000 14:22:40 -0700
Message-ID: <92A2EAF1E920D311B23E000629B30A54039373@PLEXUS02>
To: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
Hello:
I have just started digging into XML and I need some help regarding mutiple
field keys.
The new XML schema - Structures does not give any solution in how to
implement multiple field keys. The only comment in section 3.10 is a note
that mentions that is not supported by xsl:key.
Is there an alternative way of defining multi-field keys? A workaround?
Maybe I am missing something?
This is an extract of what I anm working on and I need to define two fields
as key values (they have to be together). Unfortunately the structure I came
up with allows me to indicate that they both should be present and in that
order (with group) and that both are keys. However, here I indicate that
they are independent keys and I don't want that. Is there a way of
restricting this looseness. 

<element name="primaryCustomer" type="PrimaryCustomer" >
   <complexType name="PrimaryCustomer">
      <element ref="accountNumber" minOccurs = "0"/>
      ......

      <group name = "customerKey" >
         <sequence>
            <element ref="customerNumber"/>
            <element ref="customerSuffix"/>
         </sequence>
      </group>
   </complexType>

   <key name = "customerNumber" >
     <selector> customerKey/customerNumber </selector>
     <field> @name </field> 
   </key>

   <key name = "customerSuffix" >
     <selector> customerKey/customerSuffix </selector>
     <field> @name </field> 
   </key>
 </element>

Thanks for the help.

Ani Pedersen
Received on Tuesday, 11 April 2000 17:24:02 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:52 UTC