[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

xsd:dateTime (fwd)




===============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
address@hidden             WWW: http://www.unidata.ucar.edu/
===============================================================================

---------- Forwarded message ----------
Date: Thu, 08 Jul 2004 11:58:08 -0700
From: John Caron <address@hidden>
To: address@hidden
Subject: xsd:dateTime

dates have to have the "T" in it, for the W3C profile of ISO 8601

the first 3 date elements validate, the last does not

<?xml version="1.0" encoding="UTF-8"?>
<test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="C:\temp\xml\testDate.xsd">
  <date value="1997-07-16T19:20:30Z"/>
  <date value="1997-07-16T19:20:30+01:00"/>
  <date value="1997-07-16T19:20:30"/>
  <date value="1997-07-16 19:20:30+01:00"/>
</test>

under this schema:

<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema generated by XMLSPY v5 rel. 2 U (http://www.xmlspy.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified">

  <xs:element name="date">
    <xs:complexType>
      <xs:attribute name="value" type="xs:dateTime" use="required"/>
    </xs:complexType>
  </xs:element>

  <xs:element name="test">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="date" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>


so we will standardize on that. You should reference this document in
any documentation:

http://www.w3.org/TR/NOTE-datetime

this section of catalog spec will be updated:

http://www.unidata.ucar.edu/projects/THREDDS/tech/catalog/InvCatalogSpec.html#dateType


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.