How padding char using xsl

前端 未结 3 1992
萌比男神i
萌比男神i 2021-01-27 10:42

I want padding the data with extra space(any char) using XSL version 1.0.

Name field max chars length is 10 (length must be dyanamic) chars.

Need to transfer da         


        
3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-27 11:48

    Try:

    substring(concat($yourstring, '**********'), 1, 10)
    

    Example using your input:

    XSLT 1.0

    
    
    
    
    
    
        
            
        
    
    
    
        
            
        
    
    
    
    

    Result

    
    
       Test******
    
    

    Alternatively, if your processor supports it, you could use the EXSLT str:align() function - possibly in conjunction with the str:padding() function to create the padding string dynamically.

提交回复
热议问题