﻿<?xml version='1.0' ?>
<schema
  xmlns='http://www.w3.org/1999/XMLSchema'
  targetNamespace='http://www.opentag.com/opentag'
  xmlns:t='http://www.opentag.com/opentag'>

 <!-- Informative document only.
 The XML Schema is still under development and this schema could be modified. -->

 <element name='opentag'>
  <complexType content='elementOnly'>
   <sequence maxOccurs='unbounded'>
    <element ref='t:file'/>
   </sequence>
   <attribute name='version' type='string' use='required'/>
  </complexType>
 </element>

 <element name='file'>
  <complexType content='elementOnly'>
   <element ref='t:csdef' minOccurs='0' maxOccurs='unbounded'/>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='t:note'/>
    <element ref='t:prop'/>
    <element ref='t:grp'/>
    <element ref='t:p'/>
   </choice>
   <attribute name='lc' type='language' use='required'/>
   <attribute name='tool' type='string' use='required'/>
   <attribute name='datatype' type='string' use='required'/>
   <attribute name='original' type='string' use='required'/>
   <attribute name='reference' type='string' use='optional'/>
   <attribute name='date' type='string' use='optional'/>
   <attribute name='ws' type='string' use='optional'/>
   <attribute name='ts' type='string' use='optional'/>
   <attribute name='type' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='grp'>
  <complexType content='elementOnly'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='t:grp'/>
    <element ref='t:p'/>
    <element ref='t:note'/>
    <element ref='t:prop'/>
   </choice>
   <attribute name='lc' type='language' use='optional'/>
   <attribute name='tool' type='string' use='optional'/>
   <attribute name='datatype' type='string' use='optional'/>
   <attribute name='id' type='string' use='optional'/>
   <attribute name='rid' type='string' use='optional'/>
   <attribute name='coord' type='string' use='optional'/>
   <attribute name='font' type='string' use='optional'/>
   <attribute name='type' type='string' use='optional'/>
   <attribute name='ws' type='string' use='optional'/>
   <attribute name='ts' type='string' use='optional'/>
   <attribute name='var' type='string' use='optional'/>
   <attribute name='cond' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='note'>
  <complexType content='mixed'>
   <attribute name='lc' type='language' use='optional'/>
   <attribute name='rid' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='prop'>
  <complexType content='mixed'>
   <attribute name='lc' type='language' use='optional'/>
   <attribute name='type' type='string' use='required'/>
   <attribute name='rid' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='csdef'>
  <complexType content='elementOnly'>
   <element ref='t:note' minOccurs='0' maxOccurs='unbounded'/>
   <element ref='t:map' maxOccurs='unbounded'/>
   <attribute name='name' type='string' use='required'/>
   <attribute name='base' type='string' use='required'/>
  </complexType>
 </element>

 <element name='map'>
  <complexType content='empty'>
   <attribute name='code' type='string' use='required'/>
   <attribute name='ucode' type='string' use='required'/>
   <attribute name='ent' type='string' use='optional'/>
   <attribute name='subst' type='string' use='optional'/>
   <attribute name='comp' type='string' use='optional'/>
   <attribute name='case' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='p'>
  <complexType content='mixed'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='t:ocs'/>
    <element ref='t:ct'/>
    <element ref='t:g'/>
    <element ref='t:x'/>
    <element ref='t:ix'/>
    <element ref='t:rf'/>
    <element ref='t:ixd'/>
    <element ref='t:mrk'/>
    <element ref='t:s'/>
   </choice>
   <attribute name='lc' type='language' use='optional'/>
   <attribute name='tool' type='string' use='optional'/>
   <attribute name='datatype' type='string' use='optional'/>
   <attribute name='id' type='string' use='optional'/>
   <attribute name='rid' type='string' use='optional'/>
   <attribute name='seg' type='string' use='optional'/>
   <attribute name='coord' type='string' use='optional'/>
   <attribute name='font' type='string' use='optional'/>
   <attribute name='type' type='string' use='optional'/>
   <attribute name='ws' type='string' use='optional'/>
   <attribute name='ts' type='string' use='optional'/>
   <attribute name='var' type='string' use='optional'/>
   <attribute name='cond' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='g'>
  <complexType content='mixed'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='t:ocs'/>
    <element ref='t:ct'/>
    <element ref='t:g'/>
    <element ref='t:x'/>
    <element ref='t:ix'/>
    <element ref='t:rf'/>
    <element ref='t:ixd'/>
    <element ref='t:mrk'/>
    <element ref='t:s'/>
   </choice>
   <attribute name='id' type='string' use='optional'/>
   <attribute name='type' type='string' use='optional'/>
   <attribute name='rid' type='string' use='optional'/>
   <attribute name='ts' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='x'>
  <complexType content='empty'>
   <attribute name='id' type='string' use='optional'/>
   <attribute name='type' type='string' use='optional'/>
   <attribute name='rid' type='string' use='optional'/>
   <attribute name='ts' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='ix'>
  <complexType content='empty'>
   <attribute name='rid' type='string' use='required'/>
   <attribute name='ts' type='string' use='optional'/>
   <attribute name='id' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='ixd'>
  <complexType content='elementOnly'>
   <sequence maxOccurs='unbounded'>
    <element ref='t:lvl'/>
   </sequence>
   <attribute name='rid' type='string' use='required'/>
   <attribute name='ts' type='string' use='optional'/>
   <attribute name='id' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='lvl'>
  <complexType content='elementOnly'>
   <element ref='t:tx'/>
   <element ref='t:so' minOccurs='0' maxOccurs='1'/>
   <attribute name='id' type='string' use='optional'/>
   <attribute name='ts' type='string' use='optional'/>
   <attribute name='seg' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='tx'>
  <complexType content='mixed'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='t:ocs'/>
    <element ref='t:ct'/>
    <element ref='t:g'/>
    <element ref='t:mrk'/>
    <element ref='t:s'/>
    <element ref='t:x'/>
    <element ref='t:rf'/>
   </choice>
   <attribute name='id' type='string' use='optional'/>
   <attribute name='ts' type='string' use='optional'/>
   <attribute name='seg' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='so'>
  <complexType content='mixed'>
   <attribute name='id' type='string' use='optional'/>
   <attribute name='ts' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='rf'>
  <complexType content='empty'>
   <attribute name='rid' type='string' use='required'/>
   <attribute name='type' type='string' use='optional'/>
   <attribute name='ts' type='string' use='optional'/>
   <attribute name='id' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='ocs'>
  <complexType content='mixed'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='t:ct'/>
    <element ref='t:g'/>
    <element ref='t:x'/>
    <element ref='t:ix'/>
    <element ref='t:rf'/>
    <element ref='t:ixd'/>
    <element ref='t:mrk'/>
    <element ref='t:s'/>
   </choice>
   <attribute name='cs' type='string' use='required'/>
   <attribute name='ts' type='string' use='optional'/>
   <attribute name='id' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='ct'>
  <complexType content='mixed'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='t:ocs'/>
    <element ref='t:g'/>
    <element ref='t:x'/>
    <element ref='t:ix'/>
    <element ref='t:rf'/>
    <element ref='t:ixd'/>
    <element ref='t:mrk'/>
    <element ref='t:s'/>
   </choice>
   <attribute name='cond' type='string' use='required'/>
   <attribute name='ts' type='string' use='optional'/>
   <attribute name='id' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='s'>
  <complexType content='mixed'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='t:ocs'/>
    <element ref='t:ct'/>
    <element ref='t:g'/>
    <element ref='t:x'/>
    <element ref='t:ix'/>
    <element ref='t:rf'/>
    <element ref='t:ixd'/>
    <element ref='t:mrk'/>
   </choice>
   <attribute name='id' type='string' use='optional'/>
   <attribute name='ts' type='string' use='optional'/>
   <attribute name='var' type='string' use='optional'/>
   <attribute name='type' type='string' use='optional'/>
   <attribute name='seg' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='mrk'>
  <complexType content='mixed'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='t:ocs'/>
    <element ref='t:ct'/>
    <element ref='t:g'/>
    <element ref='t:x'/>
    <element ref='t:ix'/>
    <element ref='t:rf'/>
    <element ref='t:ixd'/>
    <element ref='t:s'/>
   </choice>
   <attribute name='type' type='string' use='required'/>
   <attribute name='ts' type='string' use='optional'/>
   <attribute name='id' type='string' use='optional'/>
  </complexType>
 </element>
</schema>
