How to have line breaks in XML attributes?

拟墨画扇 提交于 2019-12-05 00:59:47

Basically you want to insert CRLF:

CR code: 
LF code: 


<myelement description="line1&#13;&#10;line2&#13;&#10;line3"/>

If you need it in XML attribute, you'll have to use character entities:

<element attribute="First line&#10;Second line&#10;Third line..." />

Try it like this:

<description><![CDATA[first line<br />second line<br />]]></description> 

Basically you wrap the content within your tag inside "" for the closing tag, inbetween this tag you can use
to cause a line break. If you want to double space it, use two
like this:

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!