Datatype: canonicalQuantityType

Description:

An element that is defined as a canonicalQuantityType will have the following subelements:

Proposed Usage:

This datatype was developed to test alternative methods of capturing quantities and their units of measure. It is expected that this datatype will change with time.

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="canonicalQuantityType">
     <xsd:sequence>
      <xsd:element name="value" type="xsd:double"/>
      <xsd:choice>
       <xsd:element name="UnitDefinition" type="unitMod"/>
       <xsd:element name="unitRef">
        <xsd:complexType>
         <xsd:attribute name="refTo" type="xsd:uriReference" use="required"/>
        </xsd:complexType>
       </xsd:element>
      </xsd:choice>
     </xsd:sequence>
    </xsd:complexType>
    

    Sample Usage Schema:

  • All elements are local. It is recommended that elementFormDefault be "qualified."
  •    <xsd:element name="firstValue" type="canonicalQuantityType"/>
       <xsd:element name="secondValue" type="canonicalQuantityType"/>
    

    Sample XML:

       <firstValue>
         <value>27762.335</value>
         <unitRef refTo="#m"/>
       </firstValue>
       <secondValue>
         <value>9662.401</value>
         <UnitDefinition uid="ft" symbol="ft">
           <name>International foot</name>
           <ConversionToBaseUnit baseUnit="#m">
             <factor>.3048</factor>
           </ConversionToBaseUnit>
         </UnitDefinition>
       </secondValue>
    

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