Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xslt xsl:when条件的嵌套_Xslt - Fatal编程技术网

Xslt xsl:when条件的嵌套

Xslt xsl:when条件的嵌套,xslt,Xslt,我有一个与xsl-choose相关的查询,其中使用了xsl-choose 现在我有两个xsl:when条件,如下所示 <xsl:choose> <xsl:when test=$labcVar=$cde> <xsl:when test="$erf=$der"> <xsl:value-of select="'edr'" /> </xsl:when> <xsl:otherwise>

我有一个与xsl-choose相关的查询,其中使用了xsl-choose 现在我有两个xsl:when条件,如下所示

<xsl:choose>
  <xsl:when test=$labcVar=$cde>
    <xsl:when test="$erf=$der">
      <xsl:value-of select="'edr'" />
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="'fre'" />
    </xsl:otherwise>


请告知这是否是正确的方法,因为insise xsl:when..我必须只在第一个条件变为真时才开始,唯一我应该选择第二个xsl:when条件,请告知它是否被忽略

如何使用

<xsl:when test="$labcVar=$cde and $erf=$der">
    <xsl:value-of select="'edr'" />
</xsl:when>
<xsl:otherwise>
    <xsl:value-of select="'fre'" />
</xsl:otherwise>

当时,您不能将
直接嵌套在
中,但您可以使用另一个
选择

<xsl:choose>
  <xsl:when test=$labcVar=$cde>
    <xsl:choose>
      <xsl:when test="$erf=$der">
        <xsl:value-of select="'edr'" />
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="'fre'" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:when>
</xsl:choose>


这与原始问题的逻辑不同,当
$labcVar=$cde而不是($erf=$der)
@IanRoberts:Aha,你可能是对的。当时,这个问题的格式有点不正确。我没有将任何语义归因于这些细节。