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,982
  • 16
  • 51
  • 59
flash
  • 1,231
  • 4
  • 19
  • 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
  • 42,748
  • 17
  • 132
  • 221
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,982
  • 16
  • 51
  • 59
Oded
  • 489,969
  • 99
  • 883
  • 1,009