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
Xml 使用choose when to make conditional with param for apply templates调用XSLT_Xml_Xslt_Mapping_Biztalk - Fatal编程技术网

Xml 使用choose when to make conditional with param for apply templates调用XSLT

Xml 使用choose when to make conditional with param for apply templates调用XSLT,xml,xslt,mapping,biztalk,Xml,Xslt,Mapping,Biztalk,我的情况是,我需要根据特定条件发送一个参数。我尝试在apply templates元素中使用choose when元素,但这是不允许的 带参数的apply templates元素: <xsl:apply-templates select="Header/Amounts/Totals/TotalLineAmount[string(text())]" mode="MOALoop"> <xsl:with-param name="qualifier" select="'203'

我的情况是,我需要根据特定条件发送一个参数。我尝试在apply templates元素中使用choose when元素,但这是不允许的

带参数的apply templates元素:

<xsl:apply-templates select="Header/Amounts/Totals/TotalLineAmount[string(text())]" mode="MOALoop">
    <xsl:with-param name="qualifier" select="'203'">
以下是我的选择:

<xsl:choose>
            <xsl:when test="imdQualifier != ''">
              <xsl:value-of select="$imdQualifier"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="$qualifier"/>
            </xsl:otherwise>
          </xsl:choose>
如果imdQualifier!=,那么参数应该是$imdQualifier,否则应该是203


如何在apply templates元素中实现此逻辑?

也许您的意思是这样做

<xsl:apply-templates select="Header/Amounts/Totals/TotalLineAmount[string(text())]" mode="MOALoop">
   <xsl:with-param name="qualifier">
      <xsl:choose>
        <xsl:when test="imdQualifier != ''">
          <xsl:value-of select="$imdQualifier"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="'203'"/>
        </xsl:otherwise>
      </xsl:choose>
   </xsl:with-param>
</xsl:apply-templates>

你为什么不能用地图绘制器?这是一个相当简单的操作。