Datatype: parsedTimeType

Description:

A datatype of parsedTImeType will have (up to) three subelements, representing the year, month, and day, and an optional element representing the time zone or UCT offset.

Proposed Usage:

This datatype was developed to support the Epicentre time and timestamp data types. Its intended usage is shown in the PEF time element document. However, it is clearly useful as a datatype in its own right. Its usage is shown below in the sample usage schema and sample XML.

XML Schema:

  • The schema and examples do not explicitly show the lines that set the namespaces.
  • All schema examples will use xsd: as the namespace for the schema tags and datatypes, and null for all the locally generated namespaces.
  • XML Examples will exclude namespace modifiers for clarity. Actual XML will probably need namespaces.
  • <xsd:complexType name="parsedTimeType">
     <xsd:sequence>
      <xsd:element name="hour">
       <xsd:simpleType>
        <xsd:restriction base="xsd:string">
         <xsd:pattern value="([0?1][0-9])|2[0-3])"/>
        </xsd:restriction>
       </xsd:simpleType>
      </xsd:element>
      <xsd:sequence minOccurs="0" maxOccurs="1">
       <xsd:element name="minute">
        <xsd:simpleType>
         <xsd:restriction base="xsd:string">
          <xsd:pattern value="([0?12345][0-9])"/>
         </xsd:restriction>
        </xsd:simpleType>
       </xsd:element>
       <xsd:element name="second" minOccurs="0">
        <xsd:simpleType>
         <xsd:restriction base="xsd:decimal">
          <xsd:minInclusive value="0.00"/>
          <xsd:maxInclusive value="60.00"/>
         </xsd:restriction>
        </xsd:simpleType>
       </xsd:element>
      </xsd:sequence>
      <xsd:choice>
       <xsd:element name="uctOffset">
        <xsd:simpleType>
         <xsd:restriction base="xsd:decimal">
          <xsd:minInclusive value="-12.0"/>
          <xsd:maxInclusive value="12.0"/>
         </xsd:restriction>
        </xsd:simpleType>
       </xsd:element>
       <xsd:element name="timeZone" type="xsd:string"/>
      </xsd:choice>
     </xsd:sequence>
    </xsd:complexType>
    

    Sample Usage Schema:

  • All elements are local. It is recommended that elementFormDefault be "qualified."
  • This may be used as a choice with other time datatypes to allow other formats. Note that W3C XML Schema has a time type defined that corresponds to ISO 8601.
  • It may be desirable to add an additional layer to identify the time as a parsed date so that a reader application will know. Both methods are shown below.
  • The parsedTimeType can be used with the parsedDateType to form a timestamp. This combination is shown below.
  •    <xsd:element name="StartTest" type="parsedTimeType"/>
    
       <xsd:element name="EndTest">
        <xsd:complexType>
         <xsd:sequence>
          <xsd:element name="parsedTime" type="parsedTimeType"/>
         </xsd:sequence>
        </xsd:complexType>
       </xsd:element>
    
       <xsd:element name="ProductionStartTime>
        <xsd:complexType>
         <xsd:sequence>
          <xsd:element name="parsedDate" type="parsedDateType"/>
          <xsd:element name="parsedTime" type="parsedTimeType"/>
         </xsd:sequence>
        </xsd:complexType>
       </xsd:element>
    

    Sample XML:

       <StartTest>
         <hour>07</hour>
         <minute>22</minute>
         <second>49.23</second>
       </StartTest>
     
       <EndTest>
        <parsedTime>
         <hour>09</hour>
         <minute>14</minute>
         <second>12.8</second>
        </parsedTime>
       </EndTest>
    
       <ProductionStartTime>
        <parsedDate>
         <year>1999</year>
         <month>6</month>
         <day>3</day>
        </parsedDate>
        <parsedTime>
         <hour>17</hour>
         <minute>00</minute>
         <uctOffset>-5.0</second>
        </parsedTime>
       </ProductionStartTime>
    

    Last Modified: March 21, 2001
    ©Copyright 2001 POSC. All rights reserved.