This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
XSL:T Spec - qname processing - Question/Suggestion
- From: Peter Bray <pdb_ml at yahoo dot com dot au>
- To: xsl-list <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 4 Mar 2002 12:58:39 +1100 (EST)
- Subject: [xsl] XSL:T Spec - qname processing - Question/Suggestion
- Reply-to: xsl-list at lists dot mulberrytech dot com
Greetings,
Being the programming type I find it strange that the XSL:T standard
does not allow variables / parameters expansion in qnames such as
"mode" in <apply-templates>.
While I have read part of XSL:T and XML standards regarding qnames I
can't really see why simple variable/parameter expansion is not
permitted.
Will this change in XSLT 2.0 ?
Regards,
Peter
This might be best illustrated by an example.
INVALID XSLT
============
<xsl:template name="generateTableRow">
<xsl:param name="label"/>
<xsl:param name="match"/>
<xsl:param name="count"/>
<xsl:param name="mode" select="''"/>
<!-- Other Logic and Markup -->
<xsl:apply-templates select="$match" mode="$mode"/>
<!-- Other Logic and Markup -->
</xsl:template>
VALID XSLT
==========
<xsl:template name="generateTableRow">
<xsl:param name="label"/>
<xsl:param name="match"/>
<xsl:param name="count"/>
<xsl:param name="mode" select="''"/>
<!-- Other Logic and Markup -->
<!-- xsl:apply-templates' mode is a qname
and qnames do not seem to expand variable references :-( -->
<xsl:choose>
<xsl:when test="$mode = 'RequiredByGeneration'">
<xsl:apply-templates select="$match"
mode="RequiredByGeneration"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$match"/>
</xsl:otherwise>
</xsl:choose>
<!-- Other Markup and Logic -->
</xsl:template>
http://movies.yahoo.com.au - Yahoo! Movies
- Vote for your nominees in our online Oscars pool.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list