我有以下XML文本:条件包含属性在XML文本
<input type='radio'
name={funcName}
value='true' />
我想包括checked='checked'
如果cond
是真实的。
我试过这个,
<input type='radio'
name={funcName}
value='true'
{ if (cond) "checked='checked'" else "" } />
,但它不工作。
(我真的喜欢以避免重复整个标签。)
的[?如何添加XML属性,或不取决于一个选项(可能的复制http://stackoverflow.com/questions/4777971/how-do-i-add-an-xml-attribute-or-not-depends-on-a-option) – Suma