Xml 使用choose when to make conditional with param for apply templates调用XSLT
我的情况是,我需要根据特定条件发送一个参数。我尝试在apply templates元素中使用choose when元素,但这是不允许的 带参数的apply templates元素: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'
<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>
你为什么不能用地图绘制器?这是一个相当简单的操作。