gpt4 book ai didi

xslt - xsl :choose check all xsl:when conditions

转载 作者:行者123 更新时间:2023-12-04 21:59:50 28 4
gpt4 key购买 nike

有什么办法不离开<choose>后第一 <when>匹配但继续检查其他条件?

最佳答案

我相信这是一个不。正如规范所说:

The content of the first, and only the first, xsl:when element whose test is true is instantiated. If no xsl:when is true, the content of the xsl:otherwise element is instantiated. If no xsl:when element is true, and no xsl:otherwise element is present, nothing is created.



来自: http://www.w3.org/TR/xslt#section-Conditional-Processing-with-xsl:choose

你不能让它落入其他类似的情况。只需将其转换为一组 <xsl:if>如果您需要跌倒,请互相关注

更新 .这是 O'Reilly 的 XSLT 书籍 ( http://docstore.mik.ua/orelly/xml/xslt/ch04_02.htm ) 中的引述:

The C, C++, and Java switch statement is roughly equivalent to the element. The one exception is that procedural languages tend to use fallthrough processing. In other words, if a branch of the switch statement evaluates to true, the runtime executes everything until it encounters a break statement, even if some of that code is part of other branches. The element doesn't work that way. If a given evaluates to true, only the statements inside that are evaluated

关于xslt - xsl :choose check all xsl:when conditions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10194564/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com