This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: keys and idrefs - XSLT2 request?
- To: DPawson at rnib dot org dot uk
- Subject: Re: [xsl] keys and idrefs - XSLT2 request?
- From: Jeni Tennison <jeni at jenitennison dot com>
- Date: Tue, 9 Oct 2001 13:34:15 +0100
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <9B66BBD37D5DD411B8CE00508B69700FE7A565@pborolocal.rnib.org.uk>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Dave,
> Which as you point out, indicates that XSLT has no means of using
> keys (simply) on idrefs, to find 'reverse' links.
>
> I don't particularly like the use of string routines in attributes
> to achieve this, I wonder if this drives an XSLT 2 request?
See http://www.w3.org/TR/xquery-operators/#b2b7b4c22c26c14, which as
you might guess from the anchor (!) is a description of xf:idref() to
do just what you're after, enacting the requirement 2.12 of the XSLT
2.0 Requirements.
Another approach would be to use a tokenize() extension function to
get the values against which the processes were keyed. This would work
because when a node has a node set as a key value it is indexed by the
values of all the nodes in the node set. So you could do something
like:
<xsl:key name="control"
match="process"
use="str:tokenize(@control)"/>
And of course this would work whether you had access to the DTD or
not.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list