我有一个包含3个 Headers 的XML文档 .
<page>
<title>
<title>
<title>
现在我想在一个文本字段中显示它们 . 我做了以下几点
$F(title)+","+$F(title2)+","+$F(title3)
它运作良好 . 如果title2和title3为空,则会出现问题 . 假设如果title2在XML中为空,那么结果就像打击一样:I
This is the title 1 ,,This is title 3
这有什么建议吗?
1 回答
像这样的东西应该工作:
($ F != null?$ F :“”)($ F != null?“,”$ F :“”)($ F != null ?“,”$ F :“”)
这假定:a)空意味着空b)字段$ F 永远不会为空
如果我在假设(b)上错了,那么表达式只会变得更复杂一些 . 可以办到 .