XSLT:使用多个< xsl:choose>的问题元素。 [英] XSLT: Problem with using multiple <xsl:choose> elements.

查看:115
本文介绍了XSLT:使用多个< xsl:choose>的问题元素。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我还是xslt的新手,我已经获得了一项任务,涉及将xml转换为另一种xml格式。



我有多个< xsl:choose =xmlns:xsl =#unknown>每个都有< xsl:when>条件。见下文。



我的问题是,例如,当第一个select语句的计算结果为true时,似乎代码不会转到下一个< xsl:choose>元件。它只处理一个并且不尝试评估下一个< xsl:choose> ;.



我需要能够执行所有选择语句。



我的代码示例:



Hi,

I am still new to xslt and I have been given an assignment that involves transforming xml to another xml format.

I have multiple <xsl: choose="" xmlns:xsl="#unknown"> with each having <xsl:when> conditions. see below.

My problem is when for example the first choose statement evaluates to true it seems like the code does not go to the next <xsl:choose> element. It just processes that one and does not try evaluate the next <xsl:choose>.

I need to be able to have all the choose statements to be executed.

My code sample:

 <xsl:choose>
  <xsl:when test="substring(Table/PRODUCTDESCRIPTION,1,2)='01'">
    <policytypecode>01</policytypecode>
    <xsl:call-template name="RALifeAssured" />
  </xsl:when>
</xsl:choose>
<xsl:choose>
  <xsl:when test="substring(Table/PRODUCTDESCRIPTION,1,2)='02'">
    <policytypecode>02</policytypecode>
    <xsl:call-template name="IDBLifeAssured" />
  </xsl:when>
</xsl:choose></xsl:choose></xsl:choose></xsl:when></xsl:>

推荐答案

这篇关于XSLT:使用多个&lt; xsl:choose&gt;的问题元素。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆