OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Schema for imprecise times

[ Lists Home | Date Index | Thread Index ]

Our organization has come across this requirement also.
We settled for extending the dateTime format to include a significance 
attribute (which itself has an enumeration type).  The downside is that any 
element declared to be of this type must be filled with "dummy" data to 
fulfill the requirements of dateTime type.

That is if you have a dateTime in which is accurate to the hour you would 
need to fill in the minutes and seconds with 00:00.

The advantage is that no special processing is necessary for applications 
that only accept the dataTime format only.  They only need to be aware that 
the date has a significance associated with it and deal with it accordingly.


<DateTimeElement significance="hour" xsi:type="qualifiedDateTime">
2002-11-21T09:00:00
<DateTimeElement>

<xsd:element name="DateTimeElement" type="xsd:dateTime"/>

<xsd:complexType name="qualifiedDateTime">
  <xsd:simpleContent>
   <xsd:extension base="dateTime">
    <xsd:attribute name="significance" type="dateTimeSignificanceList" 
use="required"/>
   </xsd:extension>
  </xsd:simpleContent>
</xsd:complexType>


  <xsd:simpleType name="dateTimeSignificanceList">
    <xsd:annotation>
     <xsd:documentation>
      This is an enumeration of dateTime qualifier values.
     </xsd:documentation>
    </xsd:annotation>
   <xsd:restriction base="xsd:string">
    <xsd:enumeration value="second"/>
    <xsd:enumeration value="minute"/>
    <xsd:enumeration value="hour"/>
    <xsd:enumeration value="day"/>
    <xsd:enumeration value="week"/>
    <xsd:enumeration value="month"/>
    <xsd:enumeration value="quarter"/>
    <xsd:enumeration value="year"/>
    <xsd:enumeration value="decade"/>
    <xsd:enumeration value="century"/>
   </xsd:restriction>
  </xsd:simpleType>

At 02:14 PM 11/21/02 +0000, Paul Spencer wrote:
>I am looking for any prior art in representing imprecise times in XML.
>The requirement is simple - we want the WXS dateTime format, but with
>the ability to leave out the seconds or both the minutes and seconds.
>
>Paul Spencer
>
>-----------------------------------------------------------------
>The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
>initiative of OASIS <http://www.oasis-open.org>
>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>
>To subscribe or unsubscribe from this list use the subscription
>manager: <http://lists.xml.org/ob/adm.pl>

Rick Taylor
XML Developer
PPDM Association





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS