Re: Limited XPath possibilities for fields in identity constraints

"Stefan Wachter" <stefan.wachter@db.com> writes:

> Dear all,
> 
> in the March 30 publication of the XML schema the XPath possibilities for selectors and fields were restricted compared to the full XPath possibilities. With the new proposal it is no longer possible to access ancestors, i.e. the following example is no longer valid:
> 
> <xs:element name="country">
>     <xs:complexType>
>         <xs:sequence>
>             <xs:element name="city" minOccurs="0" maxOccurs="unbounded">
>                 <xs:key name="cityIndex">
>                     <xs:selector xpath="."/>
>                     <xs:field xpath="../@countryName/> <!-- No longer allowed to access ancestor -->
>                     <xs:field xpath="@cityName/>
>                 </xs:key>
>                 <xs:complexType>
>                     <xs:attribute name="cityName" type="xs:string" use="required"/>
>                 </xs:complexType>
>             </xs:element>
>         </xs:sequence>
>         <xs:attribute name="countryName" type="xs:string" use="required"/>
>     </xs:complexType>
> </xs:element>
>
> In this example, an index is built up in which elements are inserted under compound keys that depend on an ancestor of the elements.

After a lot of negative feedback from implementors about complexity of 
implementation, and some very well-argued feedback from database
experts about nested key structures, the WG decided to simplify the
XPath expressions usable in field and selector definitions, and
postpone a proper nested keyref facility until v1.1.  This will allow 
you to declare @cityname as a key for cities within countries, and
@countryName as a key for countries within [the world], and define a
keyref which identifies a city using _both_ those keys.

Sorry for the inconvenience caused, but we thought it better to
withdraw a complex and poorly-understood facility in favour of doing
it right next time.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Thursday, 19 April 2001 05:17:20 UTC