XSLT: Add namespace to root element

前端 未结 2 1293
灰色年华
灰色年华 2020-12-09 13:28

I need to change namespaces in the root element as follows:

input document:


<         


        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 13:56

    XSLT 2.0 isn't necessary to solve this problem.

    Here is an XSLT 1.0 solution, which works equally well as XSLT 2.0 (just change the version attribute to 2.0):

    
     
    
     
      
       
      
     
    
     
       
    
          
    
          
    
          
    
          external
       
     
    
    

    When the above transformation is applied on this XML document:

    
    

    the wanted result is produced:

    
    

提交回复
热议问题