This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: xsl:key
- To: xsl-list at mulberrytech dot com
- Subject: Re: xsl:key
- From: "David Marston/CAM/Lotus" <David_Marston at lotus dot com>
- Date: Thu, 4 May 2000 11:44:11 -0400
- Reply-To: xsl-list at mulberrytech dot com
Keys offer another kind of flexibility that may be useful in a
few situations: the keyed items can be located at irregular places
in the tree. When David Carlisle says:
>Like id, key is replaceable by some construction selecting
>nodes based on an XPath expression, so you just have to trust that
>the implementors implement it at least no less efficiently
>than that.
...that's certainly a good point, but you won't always have the
alternative of an XPath expression, short of a humongous union.
More concretely, Mike French suggests that
<xsl:apply-templates
select="document('bib.xml')//entry[@name = $name]"/>
might work as an alternative to
...select="key('bib',$name)"
but that's only possible if every 'entry' of interest is two levels
down. There may be situations where that's not the case.
.................David Marston
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list