Re: XPath + namespace prefixes in key/keyref

Saul Farber <saul@syncline.com> writes:

> 2)  declare the namespace-prefix that I want right next to the xpath
> element
> 
>   <xs:element name="document">
>     <xs:complexType>
>     ...
>     <!-- insert schema-description of the children of <document> -->
>     </xs:complexType>
> 
>     <xs:key name="layerDefinitionKey">
>       <xs:selector  xpath="list:uniqueObjectList/list:uniqueObject" 
>                     xmlns:list="http://me.com/listns" />
>       <xs:field xpath="@id"/>
>     </xs:key>
> 
>     <xs:keyref name="thisStringDoesntMatter"
>                refer="tns:layerDefinitionKey">
>       <xs:selector xpath="gr:groupList/*//gr:group"
>                    xmlns:gr="http://me.com/groupns" />
>       <xs:field xpath="@id"/>
>     </xs:keyref>
> 
> However I've had no luck this way, either!

This is the correct solution, as defined in the REC, and is
implemented in at least XSV, although I can't check this precise
example because you haven't included full documents.

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 Monday, 5 November 2001 12:38:11 UTC