Xml XQuery OSB将字符串转换为短日期

Xml XQuery OSB将字符串转换为短日期,xml,xquery,osb,Xml,Xquery,Osb,我需要将字符串转换为其中一个xml节点上的日期 其中包含以下xsd: <xs:element minOccurs="0" name="executionDate" type="general:ShortDate"/> 我得到了以下错误: <con:reason xmlns:con="http://www.bea.com/wli/sb/context">OSB Insert action failed updating variable "body": {err}XP

我需要将字符串转换为其中一个xml节点上的日期 其中包含以下xsd:

  <xs:element minOccurs="0" name="executionDate" type="general:ShortDate"/>
我得到了以下错误:

<con:reason xmlns:con="http://www.bea.com/wli/sb/context">OSB Insert action failed updating variable "body": {err}XP0021: "20041212": can not cast to {http://www.w3.org/2001/XMLSchema}date: error: date: Invalid date value: wrong type: 20041212</con:reason>
OSB插入操作更新变量“body”失败:{err}XP0021:“20041212”:无法强制转换为{http://www.w3.org/2001/XMLSchema}日期:错误:日期:无效日期值:错误类型:20041212

有人能帮我吗?

在XQuery中,日期用ISO格式表示:yyyy-mm-dd。要使查询编译,您需要将其转换为:

{xs:dateTime(xs:date('2004-12-12'))}
但结果是

2004-12-12T00:00:00
我不认为你在找

你不能就这么做吗

concat(substring($date, 7, 2), substring($date, 5, 2), substring($date, 1, 4))
concat(substring($date, 7, 2), substring($date, 5, 2), substring($date, 1, 4))