Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个表格,表格上需要一个日期。日期必须采用 YYYY-MM-DD 格式并且在 2022-04-01 或之后。我正在使用 XFDL 和 XForms。我可以在日期的源代码中找到的唯一参考是,
<xforms:bind nodeset="instance('INSTANCE')/CertificatonDt" constraint=".='' or substring(., 1, 4) = '2020'" required="true()">
我只是将 2020 更改为 2022 吗?
是的!使用 XPath 1.0,substring() 函数将从代表它的字符串中提取年份。
目前的表述只是允许将 2020 年作为年份。如果您需要更复杂的测试,则必须将其替换为类似. = '' or (number(substring(., 1, 4)) = 2022 and number(substring(., 6, 2)) >= 4) or number(substring(., 1, 4)) > 2022
. = '' or (number(substring(., 1, 4)) = 2022 and number(substring(., 6, 2)) >= 4) or number(substring(., 1, 4)) > 2022