Formatting string (Removing leading zeros)

后端 未结 8 2152
鱼传尺愫
鱼传尺愫 2021-01-11 10:07

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.

8条回答
  •  春和景丽
    2021-01-11 11:08

    Just use this simple expression:

    number(.)
    

    Here is a complete example:

    
     
    
     
          
     
    
    

    When applied on this XML document:

    0001295
    

    the wanted, correct result is produced:

    1295
    

    II. Use format-number()

    format-number(., '#')
    

提交回复
热议问题