【发布时间】:2013-08-09 16:12:26
【问题描述】:
我想写一个简单的消息,中间有一个换行符。我知道在 Java 中您可以执行以下操作:
"Hey, this is a message" + \n + "...and this is the rest of it on a new line"
如何在 XML 中做同样的事情?我可以使用 \n 转义字符还是使用 html 换行符?
我想在ObjectValue 属性中的以下元素中添加一条消息:
<EnterValue ScreenName="" ObjectName="EMAIL_MESSAGE" ObjectValue=""/>
【问题讨论】:
-
Line Break in XML?的可能重复
-
@DarkCthulhu:不完全是重复 - 引用的问题旨在将 xml 元素的内容插入 html,后者需要换行符的标记表示。
标签: xml newline string-concatenation