[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Schema for imprecise times


datetime xsd
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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.