This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: xsl:key



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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]