How to implement Carriage return in XSLT

后端 未结 10 1381
甜味超标
甜味超标 2020-12-28 15:18

I want to implement carriage return within xslt. The problem is I have a varible: Step 1 = Value 1 breaktag Step 2 = Value 2 as a string and would like to appear as

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-28 15:51

    I was looking for a nice solution to this, as many would prefer, without embedding escape sequences directly in the expressions, or having weird line breaks inside of a variable. I found a hybrid of both this approaches actually works, by embedding a text node inside a variable like this:

    
    
    
    

    Another nice side-affect of this is that you can pass in whatever newline you want, be it just LF, CR, or both CRLF.

    --Daniel

提交回复
热议问题