我有以下匹配条件,用于在我发送的appName中存在值的情况下获取结果:
<xsl:if test="contains($appName , $value)">
<xsl:call-template name="formResponseBody">
</xsl:call-template>
</xsl:if>
然而,现在我不得不做完全相同的测试,但忽略了"$value“中数据的大小写。
我尝试过使用translate函数,但它们要么转换为upper,要么转换为lower,但我的测试用例是数据可以是" test“、"test”、"TesT“。
<xsl:variable name="lowercase">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<xsl:variable name="uppercase">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
<xsl:variable name="value1" select="translate($value, $uppercase, $lowercase)">
这在XSLT 1.0中是可能的吗?
发布于 2018-09-13 09:44:10
将$appName
和$value
规范化为大写或小写,然后测试规范化的$appName
是否包含规范化的$value
<xsl:if test="contains(
translate($appName, $uppercase, $lowercase) ,
translate($value, $uppercase, $lowercase))">
https://stackoverflow.com/questions/52305100
复制相似问题