W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2005

RE: Use of key/keyref - any best practices? warnings?

From: Jack Lindsey <tuquenukem@hotmail.com>
Date: Sun, 27 Feb 2005 21:32:41 -0500
Message-ID: <BAY102-F1435D92F211245BBCE89A7D7580@phx.gbl>
To: mike@saxonica.com, lists@jeffrafter.com, nwh@aber.ac.uk
Cc: xmlschema-dev@w3.org

Does that also explain (in some manner not obvious to me) why an attribute 
in an xs:field cannot be namespace prefixed, i.e. globally defined 
attributes cannot be used for this purpose?

e.g.

This is OK:

		<xs:key name="KeyClientById">
			<xs:selector xpath="my:Clients/my:Client"/>
			<xs:field xpath="@clientId"/>
		</xs:key>

But this is not:

		<xs:key name="KeyClientById">
			<xs:selector xpath="my:Clients/my:Client"/>
			<xs:field xpath="my:@clientId"/>
		</xs:key>

Just curious - not trying to fight it!

Jack

>From: "Michael Kay" <mike@saxonica.com>
>To: <lists@jeffrafter.com>, "'Nigel Hardy'" <nwh@aber.ac.uk>
>CC: <xmlschema-dev@w3.org>
>Subject: RE: Use of key/keyref - any best practices? warnings?
>Date: Sun, 27 Feb 2005 23:28:58 -0000
>
>
> > Agreed. Except that I think it feels wrong because nothing
> > else in the
> > spec works this way. QNames are already present in other
> > locations, why
> > does the default namespace not apply to the XPath steps in
> > content? No
> > don't answer that... I know I know... it's just that it
> > *should* work :)
>
>XSLT 1.0/XPath 1.0 decided that when QNames appeared in attribute content,
>they would behave like attribute names - that is, the default namespace
>would not apply; but when XML Schema 1.0 introduced namespaces in their
>content, they decided they would behave like elements - the default
>namespace *would* apply. So where you have both conventions in the same XML
>document, it is indeed confusing.
>
>We do try to coordinate, honest!
>
>Michael Kay
>http://www.saxonica.com/
>
>
>

_________________________________________________________________
Take charge with a pop-up guard built on patented Microsoft® SmartScreen 
Technology  
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines 
  Start enjoying all the benefits of MSN® Premium right now and get the 
first two months FREE*.
Received on Monday, 28 February 2005 02:33:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:49 GMT