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

后端 未结 4 1899
忘掉有多难
忘掉有多难 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:13

    The spaces in your text made this an interesting problem. To match all text() nodes below 'head', use an XPath expression to look at the ancestor.

    Here, I tokenize the string then loop through the result set changing the first character to uppercase and the following chars to lowercase.

    
    
       
           
               
           
       
    
       
           
       
    
    

提交回复
热议问题