Search code examples
xsltxslt-2.0xslt-3.0

How to Remove (0) from String in XSLT


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


Solution

  • How about:

    <xsl:value-of select="replace(input, '\(0\)|[\D]', '')" />