OpenMath 2 Table of Contents

Previous: C Restricting the OpenMath Schema (Non-Normative)
This: D OpenMath Schema in XSD Syntax (Non-Normative)
Next: E OpenMath DTD (Non-Normative)

Appendix D
OpenMath Schema in XSD Syntax (Non-Normative)

This is an XSD Schema generated from the Relax NG Schema described in Section 3.1.

    

<schema
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns:om="http://www.openmath.org/OpenMath" elementFormDefault="qualified" targetNamespace="http://www.openmath.org/OpenMath">
  <!-- OpenMath object constructor -->
  <element name="OMOBJ">
    <complexType>
      <group ref="om:omel"/>
      <attributeGroup ref="om:compound.attributes"/>
      <attribute name="version" type="xs:string"/>
    </complexType>
  </element>
  <!-- Elements which can appear inside an OpenMath object -->
  <group name="omel">
    <choice>
      <element ref="om:OMS"/>
      <element ref="om:OMV"/>
      <element ref="om:OMI"/>
      <element ref="om:OMB"/>
      <element ref="om:OMSTR"/>
      <element ref="om:OMF"/>
      <element ref="om:OMA"/>
      <element ref="om:OMBIND"/>
      <element ref="om:OME"/>
      <group ref="om:OMATTR"/>
      <element ref="om:OMR"/>
    </choice>
  </group>
  <!-- things which can be variables -->
  <group name="omvar">
    <choice>
      <element ref="om:OMV"/>
      <group ref="om:attvar"/>
    </choice>
  </group>
  <group name="attvar">
    <sequence>
      <element name="OMATTR">
        <complexType>
          <sequence>
            <element ref="om:OMATP"/>
            <choice>
              <element ref="om:OMV"/>
              <group ref="om:attvar"/>
            </choice>
          </sequence>
          <attributeGroup ref="om:common.attributes"/>
        </complexType>
      </element>
    </sequence>
  </group>
  <attributeGroup name="cdbase">
    <attribute name="cdbase" type="xs:anyURI"/>
  </attributeGroup>
  <!-- attributes common to all elements -->
  <attributeGroup name="common.attributes">
    <attribute name="id" type="xs:ID"/>
  </attributeGroup>
  <!-- attributes common to all elements that construct compount OM objects. -->
  <attributeGroup name="compound.attributes">
    <attributeGroup ref="om:common.attributes"/>
    <attributeGroup ref="om:cdbase"/>
  </attributeGroup>
  <!-- symbol -->
  <element name="OMS">
    <complexType>
      <attributeGroup ref="om:common.attributes"/>
      <attribute name="name" use="required" type="xs:NCName"/>
      <attribute name="cd" use="required" type="xs:NCName"/>
      <attributeGroup ref="om:cdbase"/>
    </complexType>
  </element>
  <!-- variable -->
  <element name="OMV">
    <complexType>
      <attributeGroup ref="om:common.attributes"/>
      <attribute name="name" use="required" type="xs:NCName"/>
    </complexType>
  </element>
  <!-- integer -->
  <element name="OMI">
    <complexType>
      <simpleContent>
        <restriction base="xs:anyType">
          <simpleType>
            <restriction base="xs:string">
              <pattern value="\s*(-\s?)?[0-9]+(\s[0-9]+)*\s*"/>
            </restriction>
          </simpleType>
          <attributeGroup ref="om:common.attributes"/>
        </restriction>
      </simpleContent>
    </complexType>
  </element>
  <!-- byte array -->
  <element name="OMB">
    <complexType>
      <simpleContent>
        <extension base="xs:base64Binary">
          <attributeGroup ref="om:common.attributes"/>
        </extension>
      </simpleContent>
    </complexType>
  </element>
  <!-- string -->
  <element name="OMSTR">
    <complexType mixed="true">
      <attributeGroup ref="om:common.attributes"/>
    </complexType>
  </element>
  <!-- IEEE floating point number -->
  <element name="OMF">
    <complexType>
      <attributeGroup ref="om:common.attributes"/>
      <attribute name="dec" type="xs:double"/>
      <attribute name="hex">
        <simpleType>
          <restriction base="xs:string">
            <pattern value="[0-9A-F]+"/>
          </restriction>
        </simpleType>
      </attribute>
    </complexType>
  </element>
  <!-- apply constructor -->
  <element name="OMA">
    <complexType>
      <group maxOccurs="unbounded" ref="om:omel"/>
      <attributeGroup ref="om:compound.attributes"/>
    </complexType>
  </element>
  <!-- binding constructor -->
  <element name="OMBIND">
    <complexType>
      <sequence>
        <group ref="om:omel"/>
        <element ref="om:OMBVAR"/>
        <group ref="om:omel"/>
      </sequence>
      <attributeGroup ref="om:compound.attributes"/>
    </complexType>
  </element>
  <!-- variables used in binding constructor -->
  <element name="OMBVAR">
    <complexType>
      <group maxOccurs="unbounded" ref="om:omvar"/>
      <attributeGroup ref="om:common.attributes"/>
    </complexType>
  </element>
  <!-- error constructor -->
  <element name="OME">
    <complexType>
      <sequence>
        <element ref="om:OMS"/>
        <choice minOccurs="0" maxOccurs="unbounded">
          <group ref="om:omel"/>
          <element ref="om:OMFOREIGN"/>
        </choice>
      </sequence>
      <attributeGroup ref="om:common.attributes"/>
    </complexType>
  </element>
  <!-- attribution constructor and attribute pair constructor -->
  <group name="OMATTR">
    <sequence>
      <element name="OMATTR">
        <complexType>
          <sequence>
            <element ref="om:OMATP"/>
            <group ref="om:omel"/>
          </sequence>
          <attributeGroup ref="om:compound.attributes"/>
        </complexType>
      </element>
    </sequence>
  </group>
  <element name="OMATP">
    <complexType>
      <sequence maxOccurs="unbounded">
        <element ref="om:OMS"/>
        <choice>
          <group ref="om:omel"/>
          <element ref="om:OMFOREIGN"/>
        </choice>
      </sequence>
      <attributeGroup ref="om:compound.attributes"/>
    </complexType>
  </element>
  <!-- foreign constructor -->
  <element name="OMFOREIGN">
    <complexType mixed="true">
      <choice minOccurs="0" maxOccurs="unbounded">
        <group ref="om:omel"/>
        <group ref="om:notom"/>
      </choice>
      <attributeGroup ref="om:compound.attributes"/>
      <attribute name="encoding" type="xs:string"/>
    </complexType>
  </element>
  <!--
    Any elements not in the om namespace
    (valid om is allowed as a descendant)
  -->
  <group name="notom">
    <sequence>
      <choice minOccurs="0">
        <any namespace="##other" processContents="skip"/>
        <any namespace="##local" processContents="skip"/>
      </choice>
    </sequence>
  </group>
  <!-- reference constructor -->
  <element name="OMR">
    <complexType>
      <attributeGroup ref="om:common.attributes"/>
      <attribute name="href" use="required" type="xs:anyURI"/>
    </complexType>
  </element>
</schema>

  
OpenMath 2 Table of Contents

Previous: C Restricting the OpenMath Schema (Non-Normative)
This: D OpenMath Schema in XSD Syntax (Non-Normative)
Next: E OpenMath DTD (Non-Normative)