0

i want to check via and xslt function if a string of an..17 and if a character like this fould it will be replaced with underscore _. My problem is that i dont know how to implement with the specific set of non ASCI characters. Should i create a set of the non ASCI characters and iterate through the string? Any ideas?

RamAlx
  • 6,976
  • 23
  • 58
  • 106

1 Answers1

1

In XSLT 2.0 or higher you can do:

replace($yourString, '[^\p{IsBasic_Latin}]', '_')

to replace all non-ASCII characters with an underscore.

Note that this will preserve all ASCII characters - including non-printable control codes.

michael.hor257k
  • 113,275
  • 6
  • 33
  • 51