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

Question on XPath expression

From: <gmacri@libero.it>
Date: Mon, 8 May 2000 14:24:33 +0200
To: www-xml-schema-comments@w3.org
Message-Id: <FU8QGX$Ik_kXNny7I_FbwyUoQkdNlyHgJW5fc0YzVmcroMQbtukL@libero.it>
In this example there is a definition of a key:
<xs:element name="car">
   <xs:complexType model="empty">
    . . .
    <xs:attribute name="regRef" type="dt:integer"/>
    <xs:attribute name="regState" type="twoLetterCode"/>
   </xs:complexType>
  </xs:element>
 </xs:complexType>

 <xs:key name="carRef" >
  <xs:selector>.//car[@regRef]</xs:selector>
   <xs:field>@regRef</xs:field>
   <xs:field>@regState</xs:field>
 </xs:keyref>
</xs:element>

If I want define a key  similar to the key defined up, can I use as 
content of <field> a name of element that not is descendant of "car" 
but is  a name of element that is, for instance, the child of an 
ancestor of car ?. 
Thank you for all.
Received on Monday, 8 May 2000 08:25:08 UTC

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