|
Subject: [xsl] XSL:T Spec - qname processing - Question/Suggestion From: Peter Bray <pdb_ml@xxxxxxxxxxxx> Date: Mon, 4 Mar 2002 12:58:39 +1100 (EST) |
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
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Combining HTML/FO StyleSh, Jeni Tennison | Thread | RE: [xsl] XSL:T Spec - qname proces, Michael Kay |
| [xsl] Combining HTML/FO StyleSheets, Peter Bray | Date | [xsl] Bibliography Namespace, Kunal H. Parikh |
| Month |