I am newbie to xslt. My requirement is to transform xml file into text file as per the business specifications. I am facing an issue with one of the string formatting issue.
As a simple alternative in XSLT 2.0 that can be used with numeric or alpha-numeric input, with or without leading zeros, you might try:
replace( $value, '^0*(..*)', '$1' )
This works because ^0*
is greedy and (..*)
captures the rest of the input after the last leading zero. $1
refers to the captured group.
Note that an input containing only zeros will output 0
.