XSL Multiple search and replace function

后端 未结 4 1518
天涯浪人
天涯浪人 2020-12-10 09:13

I am attempting to use the XSL translate() function to create something like a search and replace function as follows:



        
4条回答
  •  既然无缘
    2020-12-10 10:01

    The definition of the translate($arg, $mapString, $transString) function is:

    Returns the value of $arg modified so that every character in the value of $arg that occurs at some position N in the value of $mapString has been replaced by the character that occurs at position N in the value of $transString.

    That is, it does not replace a substring with another string, but rather maps characters to other characters. For substring replacement, use something like

    
      
      
      
      
        
          
          
          
            
            
            
          
        
        
          
        
      
    
    

提交回复
热议问题