xsl-list
[Top] [All Lists]

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

2012-05-10 08:33:28
Interesting contruction indeed!

On Thu, May 10, 2012 at 3:20 PM, Michael Kay <mike(_at_)saxonica(_dot_)com> 
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




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--