Datatype: optTypeType

Description:

This is an uncontrolled string, with an optional type attribute - also uncontrolled.

Proposed Usage:

This is a convenience datatype. There are many cases in which an element has a value, and a type attribute to help qualify that value. For example, a postal code with a type value, such as ZIP code. Or a well name, with a type attribute. If the type attribute is to be required, use the reqTypeType datatype. If the type attribute is to be restricted in its values, it is best to develop it separately.

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="optTypeType">
      <xsd:simpleContent>
        <xsd:extension base="xsd:string">
          <xsd:attribute name="type" type="xsd:string" use="optional"/>
        </xsd:extension>
      </xsd:simpleContent>
    </xsd:complexType>
    

    Sample Usage Schema:

       <element name="wellName" type="optTypeType"/>
    

    Sample XML:

       <wellName type="local field">Bojangles #6</wellName>
    

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