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]

Reply via email to