XSLT for each letter in a string

前端 未结 6 996
一向
一向 2021-01-11 17:44

I\'m writing an XSLT transformation (for XSL-FO), and need to repeat something for each letter in a string value, for example:

If string is stored in MyData/My

6条回答
  •  花落未央
    2021-01-11 18:33

    you could use a call template and pass parameters, then use recursion to call the template untill there are no characters left.

    example added below.

    on this xml

    
    
            something
    
    

    and this xslt

    
    
        
    
        
                                    
                        
                
        
    
                            
                    
                    
                                                        
                                    
                            
                            
                                    
                            
                    
            
    
    

    you will then be able to manipulate in the if statement to do further stuff!

提交回复
热议问题