|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Wish List: Allow <xsl:choose> within <xsl:call-template>
One of the first things which I found disturbing with XSL
is that the calling mechanism is extremely tedious.
However, there is an unexpected advantage to this
mechanism (if it were allowed):
<xsl:template name="base-function" >
<xsl:param name="one" select="'one-default'" />
<xsl:param name="two" select="'two-default'" />
...
</xsl:template>
<xsl:template name="derived-function">
<xsl:param name="one" />
...
<xsl:variable name="done" select="false()"/>
...
<xsl:call-template name="base-function">
<xsl:choose>
<xsl:when test="$one">
<xsl:with-param name="one" select="$one" />
</xsl:when>
<xsl:when test="$done" >
<xsl:with-param name="one" select="$done" />
</xsl:when>
</xsl:choose>
...
</xsl:call-template>
</xsl:template>
The results are suprizing. The derived
function may provides an alternative default
for parameter "one" ($done) depending on some
expression (currently false()). In addition,
it allows the user to ovverride this derived
default ($one). And, for those cases which
slip through the cracks, the base function's
default is provided. Nice. Very nice.
Clark
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








