XSLT: Change certain attribute values

后端 未结 4 1317
孤街浪徒
孤街浪徒 2021-01-12 08:16

I am a XSLT newbie and have a simple task:

Suppose I have the following XML:


    
         


        
4条回答
  •  不知归路
    2021-01-12 08:58

    You can define characters to replace and replacing chars, then use translate. You can use this XSLT:

    
        
    
        12
        AX
    
        
            
                
            
        
    
        
            
                
            
        
    
    
    

    Another way:

    
        
    
        
            
                
            
        
    
        
            
                
                    
                        A
                    
                
                
                    
                        X
                    
                
            
        
    
    
    

    will match all attributes attr1, then using xsl:choose you creates appropriate value for this attribute.

提交回复
热议问题