xslt - when-block中的if-condition

时间:2014-09-16 08:03:46

标签: if-statement

为什么if-condition在when-block中不起作用?

    <xsl:choose>
      <xsl:when test="type = 'news'">
        <xsl:if test="string-length(subtitle) > 0">
          <filter_subtitle><i>In <xsl:value-of select="subtitle"/></i></filter_subtitle>
        </xsl:if>
      </xsl:when>
      <xsl:otherwise>
        <filter_subtitle><xsl:value-of select="subtitle"/></filter_subtitle>
      </xsl:otherwise>
    </xsl:choose>

1 个答案:

答案 0 :(得分:0)

<xsl:when test="type='news' and string-length(subtitle)>0">

工作正常!

相关问题