提问人:Simran 提问时间:10/31/2023 最后编辑:Simran 更新时间:10/31/2023 访问量:33
XSLT 或 XQuery 为当前时间添加最小值
xslt or xquery to add a min to the current time
问:
我想创建一个安全标头,如下所示:
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd>
<wsu:Timestamp wsu:Id="TS-E157FC3B34ADB1C4DF16976549459948">
<wsu:Created>2023-10-18T18:49:05.994Z</wsu:Created>
<wsu:Expires>2023-10-18T18:50:05.994Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soapenv:标头>
因为我想有当前日期时间,并且
xslt 1.0 中是否有任何函数可以用来获得当前日期时间和比它多 1 分钟或在 xquery 中<wsu:Created>2023-10-18T18:49:05.994Z</wsu:Created>
<wsu:Expires> </wsu:Expires> has to be 1 min more than current time
答:
1赞
Michael Kay
10/31/2023
#1
这在 XSLT 1.0 中很难实现,但在 XSLT 2.0 或 XQuery 1.0(它们共享相同的函数库)中很容易实现。这很简单
current-dateTime() + xs:dayTimeDuration('PT1M')
评论
0赞
Simran
10/31/2023
非常感谢
评论