<schema
  xmlns='http://www.w3.org/2000/10/XMLSchema'
  targetNamespace='http://r-project.org/RGML'
  xmlns:rgml='http://r-project.org/RGML'>

 <element name='picture'>
  <complexType>
   <sequence>
    <choice minOccurs='0' maxOccurs='unbounded'>
     <element ref='rgml:path'/>
     <element ref='rgml:text'/>
    </choice>
    <element ref='rgml:summary'/>
   </sequence>
   <attribute name='version' type='string' use='required'/>
  </complexType>
 </element>

 <element name='path'>
  <complexType>
   <sequence>
    <element ref='rgml:context'/>
    <choice minOccurs='0' maxOccurs='unbounded'>
     <element ref='rgml:move'/>
     <element ref='rgml:line'/>
    </choice>
   </sequence>
   <attribute name='type' use='required'>
    <simpleType>
     <restriction base='string'>
      <enumeration value='fill'/>
      <enumeration value='stroke'/>
      <enumeration value='char'/>
      <enumeration value='text'/>
     </restriction>
    </simpleType>
   </attribute>
   <attribute name='id' type='ID' use='required'/>
  </complexType>
 </element>

 <element name='context'>
  <complexType>
   <sequence>
    <element ref='rgml:rgb'/>
    <element ref='rgml:style'/>
   </sequence>
  </complexType>
 </element>

 <element name='rgb'>
  <complexType>
   <attribute name='r' type='string' use='required'/>
   <attribute name='g' type='string' use='required'/>
   <attribute name='b' type='string' use='required'/>
  </complexType>
 </element>

 <element name='style'>
  <complexType>
   <attribute name='lwd' type='string' use='optional'/>
  </complexType>
 </element>

 <element name='text'>
  <complexType>
   <sequence>
    <element ref='rgml:context'/>
   </sequence>
   <attribute name='id' type='string' use='required'/>
   <attribute name='string' type='string' use='required'/>
   <attribute name='y' type='string' use='required'/>
   <attribute name='x' type='string' use='required'/>
   <attribute name='width' type='string' use='required'/>
   <attribute name='height' type='string' use='required'/>
  </complexType>
 </element>

 <element name='summary'>
  <complexType>
   <attribute name='count' type='string' use='required'/>
   <attribute name='ymax' type='string' use='required'/>
   <attribute name='ymin' type='string' use='required'/>
   <attribute name='xmax' type='string' use='required'/>
   <attribute name='xmin' type='string' use='required'/>
  </complexType>
 </element>
</schema>
