Add a namespace to elements

前端 未结 3 667
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-11 02:56

I have an XML document with un-namespaced elements, and I want to use XSLT to add namespaces to them. Most elements will be in namespace A; a few will be in namespace B. How

3条回答
  •  伪装坚强ぢ
    2020-12-11 03:04

    You will need two main ingredients for this recipe.

    The sauce stock will be the identity transform, and the main flavor will be given by the namespace attribute to xsl:element.

    The following, untested code, should add the http://example.com/ namespace to all elements.

    
      
        
      
    
    
    
      
        
      
    
    

    Personal message: Hello, Jeni Tennison. I know you are reading this.

提交回复
热议问题