<schema
  xmlns='http://www.w3.org/1999/XMLSchema'
  targetNamespace='http://www.w3.org/TR/REC-smil'
  xmlns:smil='http://www.w3.org/TR/REC-smil'>

  <attributeGroup name='id-attr'>
   <attribute name='id' type='ID' use='optional'/>
  </attributeGroup>

  <attributeGroup name='title-attr'>
   <attribute name='title' type='string' use='optional'/>
  </attributeGroup>

  <attributeGroup name='skip-attr'>
   <attribute name='skip-content' use='default' value='true'>
    <simpleType base='string'>
     <enumeration value='true'/>
     <enumeration value='false'/>
    </simpleType>
   </attribute>
  </attributeGroup>

  <attributeGroup name='desc-attr'>
   <attributeGroup ref='smil:title-attr'/>
   <attribute name='abstract' type='string' use='optional'/>
   <attribute name='author' type='string' use='optional'/>
   <attribute name='copyright' type='string' use='optional'/>
  </attributeGroup>

  <attributeGroup name='viewport-attrs'>
   <attribute name='height' type='string' use='optional'/>
   <attribute name='width' type='string' use='optional'/>
   <attribute name='background-color' type='string' use='optional'/>
  </attributeGroup>

  <attributeGroup name='sync-attributes'>
   <attribute name='begin' type='string' use='optional'/>
   <attribute name='end' type='string' use='optional'/>
  </attributeGroup>

  <attributeGroup name='system-attribute'>
   <attribute name='system-bitrate' type='string' use='optional'/>
   <attribute name='system-language' type='string' use='optional'/>
   <attribute name='system-required' type='NMTOKEN' use='optional'/>
   <attribute name='system-screen-size' type='string' use='optional'/>
   <attribute name='system-screen-depth' type='string' use='optional'/>
   <attribute name='system-captions' use='optional'>
    <simpleType base='string'>
     <enumeration value='on'/>
     <enumeration value='off'/>
    </simpleType>
   </attribute>
   <attribute name='system-overdub-or-caption' use='optional'>
    <simpleType base='string'>
     <enumeration value='caption'/>
     <enumeration value='overdub'/>
    </simpleType>
   </attribute>
  </attributeGroup>

  <attributeGroup name='fill-attribute'>
   <attribute name='fill' use='default' value='remove'>
    <simpleType base='string'>
     <enumeration value='remove'/>
     <enumeration value='freeze'/>
    </simpleType>
   </attribute>
  </attributeGroup>

  <attributeGroup name='mo-attributes'>
   <attributeGroup ref='smil:id-attr'/>
   <attributeGroup ref='smil:desc-attr'/>
   <attribute name='region' type='IDREF' use='optional'/>
   <attribute name='alt' type='string' use='optional'/>
   <attribute name='longdesc' type='string' use='optional'/>
   <attribute name='src' type='string' use='optional'/>
   <attribute name='type' type='string' use='optional'/>
   <attribute name='dur' type='string' use='optional'/>
   <attribute name='repeat' type='string' use='default' value='1'/>
   <attributeGroup ref='smil:fill-attribute'/>
   <attributeGroup ref='smil:sync-attributes'/>
   <attributeGroup ref='smil:system-attribute'/>
  </attributeGroup>

  <attributeGroup name='clip-attrs'>
   <attribute name='clip-begin' type='string' use='optional'/>
   <attribute name='clip-end' type='string' use='optional'/>
  </attributeGroup>

  <attributeGroup name='smil-link-attributes'>
   <attributeGroup ref='smil:id-attr'/>
   <attributeGroup ref='smil:title-attr'/>
   <attribute name='href' type='string' use='required'/>
   <attribute name='show' use='default' value='replace'>
    <simpleType base='string'>
     <enumeration value='replace'/>
     <enumeration value='new'/>
     <enumeration value='pause'/>
    </simpleType>
   </attribute>
  </attributeGroup>

 <element name='smil'>
  <complexType content='elementOnly'>
   <element ref='smil:head' minOccurs='0' maxOccurs='1'/>
   <element ref='smil:body' minOccurs='0' maxOccurs='1'/>
   <attributeGroup ref='smil:id-attr'/>
  </complexType>
 </element>

 <element name='head'>
  <complexType content='elementOnly'>
   <sequence minOccurs='0' maxOccurs='1'>
    <element ref='smil:meta' minOccurs='0' maxOccurs='unbounded'/>
    <sequence>
     <choice>
      <element ref='smil:layout'/>
      <element ref='smil:switch'/>
     </choice>
     <element ref='smil:meta' minOccurs='0' maxOccurs='unbounded'/>
    </sequence>
   </sequence>
   <attributeGroup ref='smil:id-attr'/>
  </complexType>
 </element>

 <element name='layout'>
  <complexType content='elementOnly'>
   <element ref='smil:ANY'/>
   <attributeGroup ref='smil:id-attr'/>
   <attribute name='type' type='string' use='default' value='text/smil-basic-layout'/>
  </complexType>
 </element>

 <element name='region'>
  <complexType content='empty'>
   <attributeGroup ref='smil:id-attr'/>
   <attributeGroup ref='smil:title-attr'/>
   <attributeGroup ref='smil:viewport-attrs'/>
   <attribute name='left' type='string' use='default' value='0'/>
   <attribute name='top' type='string' use='default' value='0'/>
   <attribute name='z-index' type='string' use='default' value='0'/>
   <attribute name='fit' use='default' value='hidden'>
    <simpleType base='string'>
     <enumeration value='hidden'/>
     <enumeration value='fill'/>
     <enumeration value='meet'/>
     <enumeration value='scroll'/>
     <enumeration value='slice'/>
    </simpleType>
   </attribute>
   <attributeGroup ref='smil:skip-attr'/>
  </complexType>
 </element>

 <element name='root-layout'>
  <complexType content='empty'>
   <attributeGroup ref='smil:id-attr'/>
   <attributeGroup ref='smil:title-attr'/>
   <attributeGroup ref='smil:viewport-attrs'/>
   <attributeGroup ref='smil:skip-attr'/>
  </complexType>
 </element>

 <element name='meta'>
  <complexType content='empty'>
   <attribute name='name' type='NMTOKEN' use='required'/>
   <attribute name='content' type='string' use='required'/>
   <attributeGroup ref='smil:skip-attr'/>
  </complexType>
 </element>

 <element name='body'>
  <complexType content='elementOnly'>
   <sequence minOccurs='0' maxOccurs='unbounded'>
    <choice>
     <choice>
      <element ref='smil:par'/>
      <element ref='smil:seq'/>
      <choice>
       <element ref='smil:audio'/>
       <element ref='smil:video'/>
       <element ref='smil:text'/>
       <element ref='smil:img'/>
       <element ref='smil:animation'/>
       <element ref='smil:textstream'/>
       <element ref='smil:ref'/>
      </choice>
     </choice>
     <element ref='smil:switch'/>
     <sequence>
      <element ref='smil:a'/>
     </sequence>
    </choice>
   </sequence>
   <attributeGroup ref='smil:id-attr'/>
  </complexType>
 </element>

 <element name='par'>
  <complexType content='elementOnly'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <choice>
     <element ref='smil:par'/>
     <element ref='smil:seq'/>
     <choice>
      <element ref='smil:audio'/>
      <element ref='smil:video'/>
      <element ref='smil:text'/>
      <element ref='smil:img'/>
      <element ref='smil:animation'/>
      <element ref='smil:textstream'/>
      <element ref='smil:ref'/>
     </choice>
    </choice>
    <element ref='smil:switch'/>
    <sequence>
     <element ref='smil:a'/>
    </sequence>
   </choice>
   <attributeGroup ref='smil:id-attr'/>
   <attributeGroup ref='smil:desc-attr'/>
   <attribute name='endsync' type='string' use='default' value='last'/>
   <attribute name='dur' type='string' use='optional'/>
   <attribute name='repeat' type='string' use='default' value='1'/>
   <attribute name='region' type='IDREF' use='optional'/>
   <attributeGroup ref='smil:sync-attributes'/>
   <attributeGroup ref='smil:system-attribute'/>
  </complexType>
 </element>

 <element name='seq'>
  <complexType content='elementOnly'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <choice>
     <element ref='smil:par'/>
     <element ref='smil:seq'/>
     <choice>
      <element ref='smil:audio'/>
      <element ref='smil:video'/>
      <element ref='smil:text'/>
      <element ref='smil:img'/>
      <element ref='smil:animation'/>
      <element ref='smil:textstream'/>
      <element ref='smil:ref'/>
     </choice>
    </choice>
    <element ref='smil:switch'/>
    <sequence>
     <element ref='smil:a'/>
    </sequence>
   </choice>
   <attributeGroup ref='smil:id-attr'/>
   <attributeGroup ref='smil:desc-attr'/>
   <attribute name='dur' type='string' use='optional'/>
   <attribute name='repeat' type='string' use='default' value='1'/>
   <attribute name='region' type='IDREF' use='optional'/>
   <attributeGroup ref='smil:sync-attributes'/>
   <attributeGroup ref='smil:system-attribute'/>
  </complexType>
 </element>

 <element name='switch'>
  <complexType content='elementOnly'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='smil:layout'/>
    <choice>
     <choice>
      <element ref='smil:par'/>
      <element ref='smil:seq'/>
      <choice>
       <element ref='smil:audio'/>
       <element ref='smil:video'/>
       <element ref='smil:text'/>
       <element ref='smil:img'/>
       <element ref='smil:animation'/>
       <element ref='smil:textstream'/>
       <element ref='smil:ref'/>
      </choice>
     </choice>
     <element ref='smil:switch'/>
     <sequence>
      <element ref='smil:a'/>
     </sequence>
    </choice>
   </choice>
   <attributeGroup ref='smil:id-attr'/>
   <attributeGroup ref='smil:title-attr'/>
  </complexType>
 </element>

 <element name='ref'>
  <complexType content='elementOnly'>
   <sequence minOccurs='0' maxOccurs='unbounded'>
    <element ref='smil:anchor'/>
   </sequence>
   <attributeGroup ref='smil:mo-attributes'/>
   <attributeGroup ref='smil:clip-attrs'/>
  </complexType>
 </element>

 <element name='audio'>
  <complexType content='elementOnly'>
   <sequence minOccurs='0' maxOccurs='unbounded'>
    <element ref='smil:anchor'/>
   </sequence>
   <attributeGroup ref='smil:mo-attributes'/>
   <attributeGroup ref='smil:clip-attrs'/>
  </complexType>
 </element>

 <element name='img'>
  <complexType content='elementOnly'>
   <sequence minOccurs='0' maxOccurs='unbounded'>
    <element ref='smil:anchor'/>
   </sequence>
   <attributeGroup ref='smil:mo-attributes'/>
  </complexType>
 </element>

 <element name='video'>
  <complexType content='elementOnly'>
   <sequence minOccurs='0' maxOccurs='unbounded'>
    <element ref='smil:anchor'/>
   </sequence>
   <attributeGroup ref='smil:mo-attributes'/>
   <attributeGroup ref='smil:clip-attrs'/>
  </complexType>
 </element>

 <element name='text'>
  <complexType content='elementOnly'>
   <sequence minOccurs='0' maxOccurs='unbounded'>
    <element ref='smil:anchor'/>
   </sequence>
   <attributeGroup ref='smil:mo-attributes'/>
  </complexType>
 </element>

 <element name='textstream'>
  <complexType content='elementOnly'>
   <sequence minOccurs='0' maxOccurs='unbounded'>
    <element ref='smil:anchor'/>
   </sequence>
   <attributeGroup ref='smil:mo-attributes'/>
   <attributeGroup ref='smil:clip-attrs'/>
  </complexType>
 </element>

 <element name='animation'>
  <complexType content='elementOnly'>
   <sequence minOccurs='0' maxOccurs='unbounded'>
    <element ref='smil:anchor'/>
   </sequence>
   <attributeGroup ref='smil:mo-attributes'/>
   <attributeGroup ref='smil:clip-attrs'/>
  </complexType>
 </element>

 <element name='a'>
  <complexType content='elementOnly'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='smil:par'/>
    <element ref='smil:seq'/>
    <choice>
     <element ref='smil:audio'/>
     <element ref='smil:video'/>
     <element ref='smil:text'/>
     <element ref='smil:img'/>
     <element ref='smil:animation'/>
     <element ref='smil:textstream'/>
     <element ref='smil:ref'/>
    </choice>
    <element ref='smil:switch'/>
   </choice>
   <attributeGroup ref='smil:smil-link-attributes'/>
  </complexType>
 </element>

 <element name='anchor'>
  <complexType content='empty'>
   <attributeGroup ref='smil:skip-attr'/>
   <attributeGroup ref='smil:smil-link-attributes'/>
   <attributeGroup ref='smil:sync-attributes'/>
   <attribute name='coords' type='string' use='optional'/>
  </complexType>
 </element>
</schema>
