大家好,
我试图在与条件中的值进行比较时为 XML 中的标记设置一个固定值。如
<xsl:when test="(//TestInput='XYZA') OR (//TestInput='XYZB') OR (//TestInput='XYZC') OR (//TestInput='XYZD')">abcd</xsl:when>
当我尝试使用带有标签
<TestInput>
的 XML 运行转换时,它给了我一个错误Extra illegal tokens: '(', '/', '/', 'TestInput', '=', ''XYZA'', ')', 'OR', '(', '/', '/', 'TestInput', '=', ''XYZB'', ')', 'OR', '(', '/', '/', 'TestInput', '=', ''XYZC'', ')', 'OR', '(', '/', '/', 'TestInput', '=', ''XYZD'', ')'
请帮助我根据在 where 子句中使用 OR 运算符的条件设置此标记的值。
提前致谢
最佳答案
大小写与 XML/XSLT/XPath 相关,因此请使用 or
而不是 OR
.
关于xslt - 使用 XSLT 的 where 子句中的 bool 运算符 OR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11617668/