RE: xsl:variable and match

Subject: RE: xsl:variable and match
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Mon, 22 May 2000 18:04:54 +0100
> >Can I use a variable in the match part of xsl:template?
> ><xsl:variable name="x" select="/ROWSET/REPLACE/@EL"/>
> ><xsl:template match="/ROWSET/{$x}">
> >     <NEWELEMENT><xsl:apply-templates/></NEWELEMENT>
> ></xsl:template>
> 
> Although you can't use it the way you have indicated above, 
> it isn't a blanket truth that a variable name cannot be used at all in 
> the match part of a template.

Oh yes it is. First para of XSLT 5.3 after the format box.

> 
> Interestingly, Saxon gives an error on this stylesheet that 
> works fine with XT.

The spec was changed after I reported logical inconsistencies that could
result, this was quite late in the day so xt probably implements an older
version of the spec.

(But there are still some opportunities for circularity left, e.g. a key
that is defined directly or indirectly in terms of itself).

Mike Kay  


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread