Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Date XPath-日期为空_Date_Datetime_Xpath_Infopath2010 - Fatal编程技术网

Date XPath-日期为空

Date XPath-日期为空,date,datetime,xpath,infopath2010,Date,Datetime,Xpath,Infopath2010,使用XPath,如何确定日期或日期时间字段是null还是空白 我使用concat方法作为XPath if语句的替代 concat( substring(../preceding-sibling::my:PerDiem[1]/my:perDiemEnd, 1, ../preceding-sibling::my:PerDiem[1]/my:perDiemEnd = "" * string-length(../preceding-sibling::my:PerDiem[1]/my:perDiemEnd

使用XPath,如何确定日期或日期时间字段是null还是空白

我使用concat方法作为XPath if语句的替代

concat(
substring(../preceding-sibling::my:PerDiem[1]/my:perDiemEnd, 1, ../preceding-sibling::my:PerDiem[1]/my:perDiemEnd = "" * string-length(../preceding-sibling::my:PerDiem[1]/my:perDiemEnd)),
substring(/my:ExpenseForm/my:ExpenseHeader/my:departureDateTime, 1, not(../preceding-sibling::my:PerDiem[1]/my:perDiemEnd = "") * string-length(/my:ExpenseForm/my:ExpenseHeader/my:departureDateTime))
)

更多信息: 在Infopath 2010中,重复表有两个日期/时间字段,分别称为perDiemStart和perDiemEnd。在重复表中,下一个perDiemStart是上一个perDiemEnd。如果perDiemStart的默认值是
。/前面的兄弟姐妹::my:PerDiem[1]/my:perDiemEnd

但是对于第一个perDiemStart(因为以前的perDiemEnd不存在,我想它应该是null/空白)。我希望第一个(空白)值不同:departureDateTime节点的值

节点位置:

/my:ExpenseForm/my:ExpenseHeader/my:departureDateTime

/my:ExpenseForm/my:PerDiemDetails/my:PerDiems/my:PerDiem/my:perDiemStart

/my:ExpenseForm/my:PerDiemDetails/my:PerDiems/my:PerDiem/my:perDiemEnd
这有帮助吗

基本上,它们通过获取旧日期(例如1900-01-01)之后的日期集,然后使用“否”查看哪些节点将被排除,从而检测空日期。

这有帮助吗


基本上,它们通过获取旧日期(例如1900-01-01)之后的日期集来检测空日期,然后使用“否”查看哪些节点将被排除。

要检查是否已填充:

perDiemStart[text()]
要检查它是否为空/空:

perDiemStart[not(text())]

要检查是否已填充,请执行以下操作:

perDiemStart[text()]
要检查它是否为空/空:

perDiemStart[not(text())]

如果您需要一个有意义且有用的答案,那么需要提供一个小样本XML文档,解释哪些节点持有日期值,以及XPath表达式的计算结果应该是什么。请编辑问题并指定缺少的重要信息。如果需要有意义和有用的答案,需要提供一个小样本XML文档,解释哪些节点包含日期值以及XPath表达式的计算结果。请编辑问题并指定缺少的重要信息。