Subject: RE: Wish List: Allow <xsl:choose> within <xsl:call-template> From: "Clark C. Evans" <clark.evans@xxxxxxxxxxxxxxxxxxxx> Date: Thu, 11 Nov 1999 18:56:33 -0500 (EST) |
On Thu, 11 Nov 1999, Mike Brown wrote: > I think I'm starting to see where Clark was going with this. The problem > here is that now $par_one is a result tree fragment consisting of a text > node with the string value of $one or $done. Maybe $one or $done was > actually a boolean or a node-set, for example. The template that $par_one is > passed to as a parameter is probably expecting a certain data type. Yes! More importantly, the template being called (subclassed) has 10 parameters... each with intelligent defaults which I don't want to duplicate. Here is the simple case, I'd just like to conditionally include a parameter when calling a template: <xsl:template name="derived-function" > <xsl:param name="one" /> ... <xsl:call-template name="base-function"> <xsl:if test="$one" > <xsl:with-param name="one" select="$one" /> </xsl:if </xsl:call-template> ... </xsl:template> And once again, its not the single parameter case that it important, it is the 10 parameter case, with 10! permutations that I'm having problems with. As a work around, I had to make each "default" parameter a seperate template for now, and use xt:node-set to convert the fragment to a result set... but this is nasty. The above is very cool (and useful) a form which is not possible in most procedural languages. ;) Clark XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Wish List: Allow <xsl:choose> w, Mike Brown | Thread | RE: Wish List: Allow <xsl:choose> w, Kay Michael |
count() woes, Natalie Rooney | Date | Re: count() woes, Clark C. Evans |
Month |