【问题标题】:Schema validation error when accepting datetime接受日期时间时的架构验证错误
【发布时间】:2016-12-26 05:03:57
【问题描述】:

我们在 XML 中有一个字段,该字段将带有日期和时间戳。

前 : 2016-12-22 10:36:46

在我们的 Schema 中,我们将该元素定义为

<xs:element name="REJECTTIME" minOccurs="0"  type="xs:datetime"/>

但是我们遇到了如下的致命错误

元素的类型={http://www.w3.org/2001/XMLSchema}datetime,其中 不存在。

【问题讨论】:

    标签: xslt-1.0 xsd-validation ibm-datapower


    【解决方案1】:

    应该是这样的

    type="xs:dateTime"
                 ^
    

    而不是

    type="xs:datetime"
    

    【讨论】:

    • 感谢快速回复....但是 xs:dateTime 将接受带有“T”的日期和时间 2016-12-22T10:36:46 我们有任何datetype 将接受以下格式的日期和时间 2016-12-22 10:36:46
    • 您可以使用xs:string 数据类型并添加pattern 限制。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-02-12
    • 2023-03-09
    • 2021-10-09
    • 1970-01-01
    • 1970-01-01
    • 2021-12-14
    • 1970-01-01
    相关资源
    最近更新 更多