日期到日期时间的 XQuery 转换

发布于 2024-09-16 03:13:40 字数 162 浏览 1 评论 0原文

我有一个变量参数,其格式为 XML 中的 date 类型。我需要将该参数转换为 dateTime 格式,以便另一个变量接受我的复制操作。这是在 BPEL 中完成的,但无论处理语言如何,XQuery 的表达式构建器都应该相同。非常感谢您的帮助。

I have a variable parameter that is formatted to the date type in XML. I need to convert that parameter into the dateTime format for another variable to accept my copy operation. This is being done in BPEL, but the expression builder for XQuery should be the same regardless of the processing language. Thanks very much for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

上课铃就是安魂曲 2024-09-23 03:13:40

当 $date 保存 xs:date 值时,然后

$date cast as xs:dateTime

将完成这项工作。请参阅 转换 部分www.w3.org/TR/xquery/" rel="noreferrer">XQuery 建议 了解详细信息

或者,您可以将 xs:date 值传递到 XQuery 建议。 org/TR/xquery-operators/#constructor-functions" rel="noreferrer">xs:dateTime 构造函数:

xs:dateTime($date)

还有一个特殊的构造函数 fn:dateTime 控制时间部分:

fn:dateTime($date, xs:time("17:30:00"))

When $date holds the xs:date value, then

$date cast as xs:dateTime

will do the job. See the section on casting in the XQuery recommendation for details

Alternatively, you could pass the xs:date value into the xs:dateTime constructor function:

xs:dateTime($date)

Also there is a special constructor function fn:dateTime that gives control of the time part:

fn:dateTime($date, xs:time("17:30:00"))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文