0

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>
approxiblue
  • 6,822
  • 16
  • 49
  • 58
flash
  • 1,211
  • 4
  • 18
  • 23

2 Answers2

1

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

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

Community
  • 1
  • 1
lexicore
  • 41,128
  • 16
  • 120
  • 206
0

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>
approxiblue
  • 6,822
  • 16
  • 49
  • 58
Oded
  • 477,625
  • 97
  • 867
  • 998