Re: Specifying key/keyrefs constraints for Link/XPointer 'bare names'.

Eric van der Vlist <vdv@dyomedea.com> writes:

> Hi,
> 
> Looking for a workaround for this issue (now posted on
> www-xml-schema-comments@w3.org where it belongs), I think I have found
> an implementation problem, though it can also be seen as a way to
> understand the XPath rec.
> 
> My idea is to use, as it's possible with XSLT/XPATH a unique ID defined
> through a minimal DTD.
> 
> I have added the following in my document:
> 
> <!DOCTYPE library [
> <!ATTLIST author id ID #IMPLIED>
> <!ATTLIST book id ID #IMPLIED>
> <!ATTLIST character id ID #IMPLIED>
> ]>
> 
> and I have tried to use it in my key/keyref:
> 
> 	<xsd:key name="authorKey">
> 		<xsd:selector>author</xsd:selector>
> 		<xsd:field>@id</xsd:field>
> 	</xsd:key>
> 
> 	<xsd:keyref refer="authorKey" name="book2author">
> 		<xsd:selector>book/author</xsd:selector>
> 		<xsd:field>id(substring-after(@xlink:href, '#'))/@id</xsd:field>
> 	</xsd:keyref>
> 
> Since the id() XPath function returns a nodeset within the document, I
> thought this should work... but it silently fails to detect keyref

If you're using XSV, as (apologetically) oft repeated here, the XPath
implementation therein is _very_ limited, and does not support _any_
functions.  I can't speak for other implementations.

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 Sunday, 3 September 2000 18:20:54 UTC