XML node format (add new line / tab)?

How do I format an XML node to fit the following format? How do I add a new line / tab?

<Note description = "Dear Sir /Madam, **(insert new line)** **(insert tab)** This is to inform you ..." />

      

Output:

Dear Sir /Madam,

     This is to inform your that the below mentioned vehicle[s] have attracted ...

      

+2


source to share


2 answers


Try

&quot;&#10;Dear Sir /Madam,&#10;&#10;&#9;This is...&quot;

      



&#10;

- string, &#9;

- tab. &quot;

will be replaced with "

.

Note that you must tell your XML parser to preserve whitespace. Otherwise &#10;&#10;&#9;

converted to one space.

+3


source


Try

<! [CDATA [br / ">]]>

instead



<br / ">

  • remove spaces from above code.

You can use the same way to write any HTML in XML, like bold, underline, italic, etc.

0


source







All Articles