Converting to text to lowercase in nodes and child nodes in xsl

后端 未结 4 1911
忘掉有多难
忘掉有多难 2021-01-20 17:53

Using xsl 2.0 I\'m trying to convert all uppercase text to having only the first letter of text in each node upper-case. Their are a large number of possible child elements.

4条回答
  •  太阳男子
    2021-01-20 18:33

    This transformation produces the wanted result regardles of the punctuation that delimits the words:

    
     
    
     
      
       
      
     
    
     
      
       
         
       
       
        
       
      
     
    
    

    When applied on the provided XML document:

     text text text
     BLAH BLAH BLAH 
    
    

    the wanted, correct result is produced:

     text text text
     Blah Blah Blah 
    
    

    When applied on this XML document:

     text text text
     BLAH$BLAH-BLAH;
    
    

    again the correct result is produced:

     text text text
     Blah$Blah-Blah;
    
    

    Explanation:

    1. Proper use of the instruction.

    2. Proper use of the \p{L} character class.

    3. Proper use of the and instructions.

提交回复
热议问题