|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Wish List: Allow <xsl:choose> within <xsl:call-template>
Well, if you really - really want to use
logic right in the place where you are calling templates,
you can
<xsl:call-template name="base-function">
<xsl:with-param name="one">
<xsl:when test="$one">
<xsl:copy-of select="$one"/>
</xsl:when>
<xsl:when test="$done" >
<xsl:copy-of select="$done" />
</xsl:when>
</xsl:with-param>
</xsl:call-template>
This will save you from creating extra 10 variables.
Inside xsl:template body you can use
select ="string($one)"
It does not help in the situation when you only
want to send sub-set of parameters.
Although it is a nice feature to have,
I am not sure that it is something unavoidable.
The worth comes to worth you can send
some special value (like "to-be-replaced-with-default")
that internally will be substituted with default.
On Thu, 11 Nov 1999, Clark C. Evans wrote:
> > On Thu, 11 Nov 1999, Nikita Ogievetsky wrote:
> > > <xsl:choose>
> > > <xsl:when test="$one">
> > > <xsl:variable name="par_one" select="$one"/>
> > > </xsl:when>
> > > <xsl:when test="$done" >
> > > <xsl:variable name="par_one" select="$done"/>
> > > </xsl:when>
> > > </xsl:choose>
> > > ...
> > > <xsl:call-template name="base-function">
> > > <xsl:with-param name="one" select="$par_one" />
> > > </xsl:call-template>
> >
> > Yes. This is logically equivalent to what I was doing,
>
> Actually, it isn't. In Nikita's case, I don't have
> the option to _not_ use the parameter in the call.
> As I do in this case:
>
> <xsl:call-template name="base-function">
> <xsl:if test="$one" >
> <xsl:with-param name="one" select="$one" />
> </xsl:if
> </xsl:call-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.
>
> 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








