我们说我有以下XML代码:
<fields>
<field default="Open Questions: Open Issues: Summary: " description="A short description about this item" id="description_test" name="Test-Description" required="true" type="text/html"/>
<field default="5" description="Some testnumber" id="testnumber" name="testnumber" required="true" type="integer"/>
</fields>
我的问题是我希望在字段中有一个预定义文本,其中包含属性type =&#34; text&#34;但是我还想在默认字段中插入文本分隔符或段落。可能它会与HTML-Tags一起使用,因为我的代码稍后会在HTML页面上显示,所以我想做的事情如下:
default="Open Questions: " + <br /> + " Open Issues: " + <br /> + " Summary: "
任何想法如何起作用?
答案 0 :(得分:0)
您可以使用&#34;回车,换行&#34;换句话说\r\n
使用他们的字符实体,其中CR(回车)代码为
,LF(换行)代码为
。您的代码将如下所示:
<fields>
<field default="Open Questions: Open Issues: Summary: " description="A short description about this item" id="description_test" name="Test-Description" required="true" type="text/html"/>
<field default="5" description="Some testnumber" id="testnumber" name="testnumber" required="true" type="integer"/>
</fields>
修改强>
您还可以明确设置换行符,看看这是否适合您:
<fields>
<field default="Open Questions:
Open Issues:
Summary: " description="A short description about this item" id="description_test" name="Test-Description" required="true" type="text/html"/>
<field default="5" description="Some testnumber" id="testnumber" name="testnumber" required="true" type="integer"/>
</fields>