Datatype: quantityType

Description:

The quantityType datatype will contain the numeric value as the value of the element, and a reference to a unit of measure as an attribute. It is intended as a compact way to bundle a value and its unit of measure together.

Proposed Usage:

This datatype was developed to support the Epicentre quantity data type. Its intended usage is shown in the PEF quantity element document. Usage as a useful datatype is shown in the following 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="quantityType">
      <xsd:simpleContent>
        <xsd:extension base="xsd:double">
          <xsd:attribute name="unit" type="xsd:uriReference" use="required"/>
        </xsd:extension>
      </xsd:simpleContent>
    </xsd:complexType>
    

    Sample Usage Schema:

    <xsd:element name="someValue" type="quantityType"/>
    

    Sample XML:

       <someValue uom="#m">27762.335</someValue>
    

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