This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: xsl:variable and match
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: xsl:variable and match
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Mon, 22 May 2000 18:04:54 +0100
- Reply-To: xsl-list at mulberrytech dot com
> >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