如何检查例如字符串数组是否包含字符串?
<xsl:if test="inArray('a', $array)"></xsl:if>
Run Code Online (Sandbox Code Playgroud)
如果通过数组你的意思是序列,只需使用=...
<xsl:variable name="array" select="('a','b','c')"/>
<xsl:if test="$array='a'"></xsl:if>
Run Code Online (Sandbox Code Playgroud)
您还可以在数组/序列中测试多个值(如果序列中存在a或c存在,此示例将评估为true ):
<xsl:if test="$array=('a','c')"></xsl:if>
Run Code Online (Sandbox Code Playgroud)