How to add a new line in XML

asked 14 Sep '11, 06:34

Jake's gravatar image

Jake ♦♦
796222226235
accept rate: 98%


Sometimes you need to add a new line ("\n") to a field in your XML project file. The correct way of doing this in XML is using the 
 escape code. Your code should look as follows:

 <addTextToFile>
    <file>${installdir}/foo.txt</file>
    <text>line1&#xA;line2&#xA;line3</text>
 </addTextToFile>

Similarly, a tab can be encoded as &#x9;

link

answered 14 Sep '11, 06:35

Jake's gravatar image

Jake ♦♦
796222226235
accept rate: 98%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×20
×11
×2

Asked: 14 Sep '11, 06:34

Seen: 4,899 times

Last updated: 14 Sep '11, 06:35