tags:

views:

380

answers:

1

How do I remove non-alphanumeric characters from a string in XSL?

Thanks!

+4  A: 

If you define non-alphanumeric as [^a-zA-Z0-9]:

<xsl:value-of select="
  translate(
    string,
    translate(
      string, 
      'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
      ''
    ),
    ''
  )
" />
Tomalak