This gives a complete answer to your question. What you do is based on what you need to do ... simply insert a w:br or adding new structure like adding multiple w:p elements.
Using XSLT and WordML - new line character
質問
I am using XSLT to create a Word Document using WordML. I have most of what I need, except the newline characters which come out of the database as \r\n
I can change these to whatever is required, but I cannot find out what to change them to. What character should I change them to please so newlines appear in the resulting Word document.
Many thanks
解決
他のヒント
In addition to the answer above I tend to put <w:tab/>
before the <w:br/>
in the separate run. The reason for that is if the text is fully justified and you don't add the tab it will add a lot of spacing between the words in a line if there are only few words on that line.
<w:r> <w:tab/> </w:r> <w:r> <w:br/> </w:r>
You probably will want to add a new w:p element, because the w:br approach adds a "manual line break" (which will have different searching behavior).