This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: variables/parameters in match of xsl:key, 'ends-with'
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] variables/parameters in match of xsl:key, 'ends-with'
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Wed, 10 Jan 2001 17:00:27 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
> Does anyone know if future versions of XSLT will allow variables or
> parameters in the "match" attribute of xsl:key?
No, I can say confidently that no-one does.
>
> In particular, I have a parameterized XSLT stylesheet (using
> xsl:param), where the param is used to filter what is generated.
>
Yes, that's a nice use case. The restriction was put it to ensure
non-circularity (the value of the variable might depend on the key), but in
fact the restrictions on non-circularity that are there in the spec are
already broken, e.g. there's nothing in the spec that stops you writing:
<xsl:variable name="x">
<xsl:call-template name="y"/>
</xsl:variable>
<xsl:template name="y">
<xsl:value-of select="$x"/>
</xsl:template>
so my view would be to get rid of all the "static" restrictions and replace
them with a run-time restriction that says you can't refer to a variable
while you are evaluating it. It's quite hard, though, to express that in
rigorous language.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list