首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > XML SOAP >

请问XSL字符串判断及字符串的拆分的语法有关问题

2012-03-15 
请教XSL字符串判断及字符串的拆分的语法问题XML codexsl:for-each selecttickets/ticket/trips/trip

请教XSL字符串判断及字符串的拆分的语法问题

XML code
<xsl:for-each select="tickets/ticket/trips/trip" ><td>    <FONT class="dynamicData">             <!-- <xsl:value-of select="ancestor::ticketOrder/reasonCode" />  需要替换的地方 -->    </FONT>   </td></xsl:for-each>


reasonCode中的值有可能为: 1:前后2小时 2:前后3小时;1:提前3天 2:提前2天
现在我要从trip节点中取出tripSequence节点的值,如果tripSequence为0则显示: 1:前后2小时 2:提前3天 如果tripSequence为1则显示 1:前后3小时 2:提前2天

[解决办法]
XML code
<xsl:choose>    <xsl:when test="tripSequence=0">        1:前后2小时 2:提前3天</td>    </xsl:when>    <xsl:when test="tripSequence=1">        1:前后3小时 2:提前2天</td>    </xsl:when></xsl:choose> 

热点排行