Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在 XSL 中评估字符串表达式?
例子:
<myItem id="1"> <validator expression="$someVariable = '3'" /> </myItem> ... <xsl:variable name="someVariable" select="3" /> <xsl:if test="@expression"> ...
我意识到这种语法不能按我想要的方式工作,但是有没有办法将测试表达式存储在变量中然后评估表达式?
根据 Michael Kay(XSLT 2.0 和 XPath 2.0,第 4 版,第 1210 页)的说法,动态评估没有进入 XSLT 2.0
EXSLT 中有一个dyn:evaluate()函数,Saxon 也实现了这个函数。
dyn:evaluate()