Question

I have to check if a value matches a certain string, and the input may be in any case.

<xsl:if test="$adminStatus='Down'">
  do something
</xsl:if>
Was it helpful?

Solution

Use the translate() function on both $adminStatus and target value.

How can I convert a string to upper- or lower-case with XSLT?

OTHER TIPS

You use the translate function to convert all upper case to lower case.

<xsl:if test="translate($adminStatus, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = 'down'">
  do something
</xsl:if>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top