RE: [xsl] variables/parameters in match of xsl:key, 'ends-with'

Subject: RE: [xsl] variables/parameters in match of xsl:key, 'ends-with'
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Wed, 10 Jan 2001 17:00:27 -0000
> 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:template name="y">
  <xsl:value-of select="$x"/>

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:

Current Thread