[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] use choose in call-templates not possble


Subject: Re: [xsl] use choose in call-templates not possble
From: Vasu Chakkera <vasucv@xxxxxxxxx>
Date: Sun, 27 May 2012 09:07:36 +0100

>>  <xsl:with-param name="factor" select="if (FCDecimalPlace  != '')
>> then FCDecimalPlace else LCDecimalPlace"/>

This With XSLT2??

<xsl:with-param name="factor" select="(string(FCDecimalPlace),
LCDecimalPlace )[1]"/>

Vasu


On 10 May 2012 14:20, Michael Kay <mike@xxxxxxxxxxxx> wrote:
>
>
> On 10/05/2012 13:39, Jakub Mal} wrote:
>>
>> You can also use if-then-else in select (XPath/XSLT 2.0).
>>
>> <xsl:call-template name="translateDcml">
>>        <xsl:with-param name="factor" select="if (FCDecimalPlace  != '')
>> then FCDecimalPlace else LCDecimalPlace"/>
>> </xsl:call-template>
>>
> And even in 1.0, this is a case where the "Carlisle conditional" may be
> useful:
>
> <xsl:variable name="f" select="boolean(FCDecimalPlace != '')"/>
>
> <xsl:call-template name="translateDcml">
>    <xsl:with-param name="factor"
>        select="FCDecimalPlace[$f] | LCDecimalPlace[not($f)]"/>
> </xsl:call-template>
>
> Michael Kay
> Saxonica
>



--
Vasu Chakkera
NodeLogic Limited
Oxford
www.node-logic.com
==============


Current Thread