-1

I wanted to format the string in XSLT-

Input 'ABC01312()wer**(0)**e66'

Expected output - '0131266

I am using below code but here unable to remove**(0)**

translate($String, translate($String, '0123456789', ''), '')

Replace is not working, tried with replace($TelephoneNumber,'(0)','')

Please help to remove (0)

Thanks

Awanish
  • 3
  • 2
  • We can't infer a spec from a single example. We need to know what other strings might be encountered, and what the general rules are. Are you only trying to remove a "0" between parentheses, or might it be any digit? Might there be more than one "()" in the string? etc etc. – Michael Kay Apr 22 '20 at 13:58
  • Don't tell us something "isn't working", tell us how it fails. What's the error message? A common reason for replace() failing is that you're using an XSLT 1.0 processor; if you told us the error message, we would be able to tell you the reason. – Michael Kay Apr 22 '20 at 14:00

1 Answers1

0

How about:

<xsl:value-of select="replace(input, '\(0\)|[\D]', '')" />
michael.hor257k
  • 113,275
  • 6
  • 33
  • 51