我有一个问题,我需要匹配 xsl choose 子句中的两个参数,有没有办法实现这个?
例如:xsl:when test= 我需要检查两个参数,这样我就可以检查 相同的价格,但没有更低的订单类型。
<xsl:choose>
<xsl:when test="price = 10" && "OrderType='P' ">
<td bgcolor="#ff00ff">
<xsl:value-of select="artist"/></td>
</xsl:when>
<xsl:when test="price = 10">
<td bgcolor="#cccccc">
<xsl:value-of select="artist"/></td>
</xsl:when>
<xsl:otherwise>
<td><xsl:value-of select="artist"/></td>
</xsl:otherwise>
</xsl:choose>
最佳答案
<xsl:choose>
<xsl:when test="price = 10 and OrderType='P' ">
<td bgcolor="#ff00ff">
<xsl:value-of select="artist"/></td>
</xsl:when>
<xsl:when test="price = 10">
<td bgcolor="#cccccc">
<xsl:value-of select="artist"/></td>
</xsl:when>
<xsl:otherwise>
<td><xsl:value-of select="artist"/></td>
</xsl:otherwise>
</xsl:choose>
关于XSLT - xsl选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17218140/