Sharepoint XPath中用于测试null的三元逻辑
在XPath1.0中,是否有方法测试求值表达式的存在性并代表它修改结果 我正在尝试实现以下伪代码:Sharepoint XPath中用于测试null的三元逻辑,sharepoint,xpath,infopath,logical-operators,Sharepoint,Xpath,Infopath,Logical Operators,在XPath1.0中,是否有方法测试求值表达式的存在性并代表它修改结果 我正在尝试实现以下伪代码: if ID is empty then 0 + 1 else ID + 1 到目前为止的实际代码: xdMath:Eval(xdMath:Max( xdXDocument:GetDOM("FetchID")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:ID), 'concat("(ID = "
if ID is empty
then 0 + 1
else ID + 1
到目前为止的实际代码:
xdMath:Eval(xdMath:Max(
xdXDocument:GetDOM("FetchID")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:ID),
'concat("(ID = ", (d:ID or 0) + 1,")")'
)
当列表中没有项目时,此表达式不起作用,因此
max(d:ID)
为空 通常会有一个丑陋的解决方法,比如
concat("0", ID) + 1