How to convert tags in all tags in xml to lowercase without changing case of atribute values?

前端 未结 4 629
面向向阳花
面向向阳花 2021-01-25 08:10

I\'ve inherited some xml files which has all tags in uppercase. I would like to convert them to lowercase using either a regular expression or via XSLT. It would be handy to be

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-25 08:32

    Try (untested):

    XSLT 2.0:

    
    
    
    
    
        
            
        
    
    
    
        
            
        
    
    
    
        
    
    
    
    

    The XSLT 1.0 version of the above would go like this:

    
    
    
    
    
    
    
    
        
            
        
    
    
    
        
            
        
    
    
    
        
    
    
    
    

    However, this is assuming your element and attribute names do not contain upper-case characters other than the 26 explicitly listed (i.e. no Russian, Greek, diacritics, etc.).

提交回复
热议问题