XSLT replace value

后端 未结 1 1134
情话喂你
情话喂你 2020-12-31 09:24

I have an XML like this



   

        
1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-31 09:55

    Basically you want an identity transform, with override rules.

    The following transform

    
    
    
        
            
                
            
        
    
        Y
    
    
    

    applied to your input, produces the result:

    
       Y
       Add1
       Add2
    
    

    The first template is an identity transform, which copies the input document exactly.

    The second template overrides text nodes with a value of X that are children of a PrintDollarsAndCents template. Note that it emits the value Y instead of its actual content.

    0 讨论(0)
提交回复
热议问题