Thanks Tobia,
I thought about these solution but i really wonder why it do not work
I think it is possible with xslt version 2.0 http://zvon.org/xxl/XSL-Ref/Tutorials/Conditional-Expressions/ce1.html

so what i need is a xslt 2.0 transformer.
the question is now, how can i set it with C2.2 ??

Tobia Conforto a écrit :
Sébastien Geindre wrote:
I try to do this in a xslt stylesheet :
<xsl:variable name="top" select="if(($type='cb') and 
($typeName!='wims:statusweatherproduct')) then 'max_fub' else 'top'"/>

"if (...) then ... else ..." is not an XPath 1.0 expression!

You have a few options.
One is to use standard XSLT constructs:

<xsl:variable name="top">
  <xsl:choose>
    <xsl:when test="$type='cb' and $typeName!='wims:...'">max_fub</xsl:when>
    <xsl:otherwise>top</xsl:otherwise>
  </xsl:choose>
</xsl:variable>

Another is to define a custom function:

<func:function name="my:if">
  <xsl:param name="test"/>
  <xsl:param name="then"/>
  <xsl:param name="else" select="false()"/>
  <xsl:choose>
    <xsl:when test="$test">
      <func:result select="$then"/>
    </xsl:when>
    <xsl:otherwise>
      <func:result select="$else"/>
    </xsl:otherwise>
  </xsl:choose>
</func:function>

And then use it like this:

<xsl:variable name="top"
    select="my:if($type='cb' and $typeName!='wims:...', 'max_fub', 'top')"/>

See here for custom functions: http://exslt.org/func/index.html


it works with C2.1

I can't see how.
Maybe it's a custom extension of the XSLT processor you use?


Tobia

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to