home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Inne / Gry / Enigma / Enigma-1.01-w7.exe / data / schemas / level.xsd < prev    next >
Extensible Markup Language  |  2009-12-13  |  19KB  |  342 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace="http://enigma-game.org/schema/level/1" xmlns:el="http://enigma-game.org/schema/level/1" elementFormDefault="qualified" attributeFormDefault="qualified" version="0.5" xml:lang="en">
  3.   <xs:annotation>
  4.     <xs:documentation>
  5.       XML schema definitions for Enigma levels
  6.       Copyright ┬⌐ 2006 Ronald Lamprecht
  7.       GPL2
  8.     </xs:documentation>
  9.   </xs:annotation>
  10.   <xs:element name="level">
  11.     <xs:complexType>
  12.       <xs:sequence>
  13.         <xs:element name="protected" minOccurs="1" maxOccurs="1">
  14.           <xs:annotation>
  15.             <xs:documentation>
  16.               The protected section is reserved for data from the level author.
  17.             </xs:documentation>
  18.           </xs:annotation>
  19.           <xs:complexType>
  20.             <xs:sequence>
  21.               <xs:element name="info" minOccurs="1" maxOccurs="1">
  22.                 <xs:complexType>
  23.                   <xs:sequence>
  24.                     <xs:element name="identity" minOccurs="1" maxOccurs="1">
  25.                       <xs:complexType>
  26.                         <xs:attribute name="title" type="xs:string" use="required"/>
  27.                         <xs:attribute name="subtitle" type="xs:string" use="optional"/>
  28.                         <xs:attribute name="id" type="xs:string" use="required"/>
  29.                       </xs:complexType>
  30.                     </xs:element> <!-- identity -->
  31.                     <xs:element name="version" minOccurs="1" maxOccurs="1">
  32.                       <xs:complexType>
  33.                         <xs:attribute name="score" type="xs:positiveInteger" use="required"/>
  34.                         <xs:attribute name="release" type="xs:positiveInteger" use="required"/>
  35.                         <xs:attribute name="revision" use="required">
  36.                           <xs:simpleType>
  37.                             <xs:union memberTypes="xs:unsignedShort el:revisionType"/>
  38.                           </xs:simpleType>
  39.                         </xs:attribute>
  40.                         <xs:attribute name="status" type="el:statusType" use="required"/>
  41.                       </xs:complexType>
  42.                     </xs:element> <!-- version -->
  43.                     <xs:element name="author" minOccurs="1" maxOccurs="1">
  44.                       <xs:complexType>
  45.                         <xs:attribute name="name" type="xs:string" default="anonymous" use="optional"/>
  46.                         <xs:attribute name="email" type="xs:anyURI" use="optional"/>
  47.                         <xs:attribute name="homepage" type="xs:anyURI" use="optional"/>
  48.                       </xs:complexType>
  49.                     </xs:element> <!-- author -->
  50.                     <xs:element name="copyright" minOccurs="1" maxOccurs="1" type="xs:string"/>
  51.                     <xs:element name="license" minOccurs="1" maxOccurs="1">
  52.                       <xs:complexType>
  53.                         <xs:simpleContent>
  54.                           <xs:extension base="xs:string">
  55.                             <xs:attribute name="type" type="xs:string" use="required"/>
  56.                             <xs:attribute name="open" type="xs:boolean" use="required"/>
  57.                           </xs:extension>
  58.                         </xs:simpleContent>
  59.                       </xs:complexType>
  60.                     </xs:element> <!-- license -->
  61.                     <xs:element name="compatibility" minOccurs="1" maxOccurs="1">
  62.                       <xs:complexType>
  63.                         <xs:sequence>
  64.                           <xs:element name="dependency" minOccurs="0" maxOccurs="unbounded">
  65.                             <xs:complexType>
  66.                               <xs:attribute name="path" type="xs:string" use="required"/>
  67.                               <xs:attribute name="id" type="xs:string" use="required"/>
  68.                               <xs:attribute name="release" type="xs:unsignedShort" use="required"/>
  69.                               <xs:attribute name="preload" type="xs:boolean" use="required"/>
  70.                               <xs:attribute name="url" type="xs:anyURI" use="optional"/>
  71.                             </xs:complexType>
  72.                           </xs:element> <!-- dependency -->
  73.                           <xs:element name="externaldata" minOccurs="0" maxOccurs="unbounded">
  74.                             <xs:complexType>
  75.                               <xs:attribute name="path" type="xs:string" use="optional"/>
  76.                               <xs:attribute name="url" type="xs:anyURI" use="optional"/>
  77.                             </xs:complexType>
  78.                           </xs:element> <!-- externaldata -->
  79.                           <xs:element name="editor" minOccurs="0" maxOccurs="1">
  80.                             <xs:complexType>
  81.                               <xs:attribute name="name" type="xs:string" use="required"/>
  82.                               <xs:attribute name="version" type="xs:string" use="required"/>
  83.                             </xs:complexType>
  84.                           </xs:element> <!-- editor -->
  85.                           <xs:element name="extensions" minOccurs="0" maxOccurs="1">
  86.                             <xs:complexType>
  87.                               <xs:sequence>
  88.                                 <xs:any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
  89.                               </xs:sequence>
  90.                             </xs:complexType>
  91.                           </xs:element> <!-- extensions -->
  92.                         </xs:sequence>
  93.                         <xs:attribute name="enigma" type="xs:float" use="required"/>
  94.                         <xs:attribute name="engine" type="xs:string" use="optional" default="enigma"/>
  95.                       </xs:complexType>
  96.                     </xs:element> <!-- compatibility -->
  97.                     <xs:element name="modes" minOccurs="1" maxOccurs="1">
  98.                       <xs:complexType>
  99.                         <xs:attribute name="easy" type="xs:boolean" use="required"/>
  100.                         <xs:attribute name="single" type="xs:boolean" use="required"/>
  101.                         <xs:attribute name="network" type="xs:boolean" use="required"/>
  102.                         <xs:attribute name="control" type="el:controlType" use="optional" default="force"/>
  103.                         <xs:attribute name="scoreunit" type="el:scoreunitType" use="optional" default="duration"/>
  104.                         <xs:attribute name="scoretarget" type="xs:string" use="optional" default="time"/>
  105.                       </xs:complexType>
  106.                     </xs:element> <!-- modes -->
  107.                     <xs:element name="comments" minOccurs="0" maxOccurs="1">
  108.                       <xs:complexType>
  109.                         <xs:sequence>
  110.                           <xs:element name="credits" minOccurs="0" maxOccurs="1">
  111.                             <xs:complexType>
  112.                               <xs:simpleContent>
  113.                                 <xs:extension base="xs:token">
  114.                                   <xs:attribute name="showinfo" type="xs:boolean" use="optional" default="false"/>
  115.                                   <xs:attribute name="showstart" type="xs:boolean" use="optional" default="false"/>
  116.                                 </xs:extension>
  117.                               </xs:simpleContent>
  118.                             </xs:complexType>
  119.                           </xs:element> <!-- credits -->
  120.                           <xs:element name="dedication" minOccurs="0" maxOccurs="1">
  121.                             <xs:complexType>
  122.                               <xs:simpleContent>
  123.                                 <xs:extension base="xs:token">
  124.                                   <xs:attribute name="showinfo" type="xs:boolean" use="optional" default="false"/>
  125.                                   <xs:attribute name="showstart" type="xs:boolean" use="optional" default="false"/>
  126.                                 </xs:extension>
  127.                               </xs:simpleContent>
  128.                             </xs:complexType>
  129.                           </xs:element> <!-- dedication -->
  130.                           <xs:element name="code" minOccurs="0" maxOccurs="1" type="xs:string"/>
  131.                         </xs:sequence>
  132.                       </xs:complexType>
  133.                     </xs:element> <!-- comments -->
  134.                     <xs:element name="update" minOccurs="0" maxOccurs="1">
  135.                       <xs:complexType>
  136.                         <xs:attribute name="url" type="xs:anyURI" use="required"/>
  137.                       </xs:complexType>
  138.                     </xs:element> <!-- update -->
  139.                     <xs:element name="upgrade" minOccurs="0" maxOccurs="1">
  140.                       <xs:complexType>
  141.                         <xs:attribute name="url" type="xs:anyURI" use="required"/>
  142.                         <xs:attribute name="release" type="xs:unsignedShort" use="required"/>
  143.                       </xs:complexType>
  144.                     </xs:element> <!-- upgrade -->
  145.                     <xs:element name="preview" minOccurs="0" maxOccurs="1">
  146.                       <xs:complexType>
  147.                         <xs:anyAttribute namespace="##targetNamespace" processContents="skip"/>
  148.                       </xs:complexType>
  149.                     </xs:element> <!-- preview -->
  150.                     <xs:element name="score" minOccurs="1" maxOccurs="1">
  151.                       <xs:complexType>
  152.                         <xs:attribute name="easy" type="el:scoreType" use="required"/>
  153.                         <xs:attribute name="difficult" type="el:scoreType" use="required"/> 
  154.                       </xs:complexType>
  155.                     </xs:element> <!-- score -->
  156.                     
  157.                     <xs:any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
  158.  
  159.                   </xs:sequence>
  160.                   <xs:attribute name="type" type="el:fileType" use="required"/>
  161.                   <xs:attribute name="quantity" type="xs:positiveInteger" use="optional" default="1"/>
  162.                 </xs:complexType>
  163.               </xs:element> <!-- info -->
  164.               
  165.               <xs:element name="elements" minOccurs="0" maxOccurs="1">
  166.                 <xs:complexType>
  167.                   <xs:sequence>
  168.                     <xs:any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
  169.                   </xs:sequence>
  170.                 </xs:complexType>
  171.               </xs:element> <!-- elements -->
  172.               
  173.               <xs:element name="luamain" minOccurs="0" maxOccurs="1" type="xs:string"/>
  174.               
  175.               <xs:any namespace="##other" minOccurs="0" maxOccurs="1" processContents="skip">
  176.                 <xs:annotation>
  177.                   <xs:documentation>
  178.                     Any external level editor is free to include an element of its own
  179.                     namespace for storage of any extensions. This element is ignored by
  180.                     enigma. The editor is free to supply an additional schema for its 
  181.                     element definitions.
  182.                   </xs:documentation>
  183.                 </xs:annotation>
  184.               </xs:any>
  185.               
  186.               <xs:element name="i18n" minOccurs="1" maxOccurs="1" >
  187.                 <xs:complexType>
  188.                   <xs:sequence>
  189.                     <xs:element name="string" minOccurs="0" maxOccurs="unbounded" >
  190.                       <xs:complexType>
  191.                         <xs:sequence>
  192.                           <xs:element name="english" minOccurs="1" maxOccurs="1">
  193.                             <xs:complexType>
  194.                               <xs:simpleContent>
  195.                                 <xs:extension base="xs:normalizedString">
  196.                                   <xs:attribute name="translate" type="xs:boolean" default="true"/>
  197.                                   <xs:attribute name="comment" type="xs:string" use="optional"/>
  198.                                 </xs:extension>
  199.                               </xs:simpleContent>
  200.                             </xs:complexType>
  201.                           </xs:element> <!-- english -->
  202.                           <xs:element name="translation" minOccurs="0" maxOccurs="unbounded">
  203.                             <xs:complexType>
  204.                               <xs:simpleContent>
  205.                                 <xs:extension base="xs:normalizedString">
  206.                                   <xs:attribute name="lang" type="xs:language" use="required"/>
  207.                                 </xs:extension>
  208.                               </xs:simpleContent>
  209.                             </xs:complexType>
  210.                           </xs:element> <!-- translation -->
  211.                         </xs:sequence>
  212.                         <xs:attribute name="key" type="xs:string" use="required"/>
  213.                       </xs:complexType>
  214.                     </xs:element> <!-- string -->
  215.                   </xs:sequence>
  216.                 </xs:complexType>
  217.               </xs:element> <!-- i18n -->
  218.               
  219.               <xs:any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
  220.  
  221.             </xs:sequence>
  222.             <xs:anyAttribute namespace="##targetNamespace" processContents="skip"/>
  223.           </xs:complexType>
  224.         </xs:element> <!-- protected -->
  225.         
  226.         <xs:element name="public" minOccurs="0" maxOccurs="1">
  227.           <xs:annotation>
  228.             <xs:documentation>
  229.               The pubic section for not validated additions by others. All info
  230.               in public is handeled with care by enigma. Translations will be
  231.               suggested to the official translators and only be used if confirmed
  232.               or missing in the translators translations.
  233.             </xs:documentation>
  234.           </xs:annotation>
  235.           <xs:complexType>
  236.             <xs:sequence>
  237.               <xs:element name="i18n" minOccurs="0" maxOccurs="1" >
  238.                 <xs:complexType>
  239.                   <xs:sequence>
  240.                     <xs:element name="string" minOccurs="0" maxOccurs="unbounded" >
  241.                       <xs:complexType>
  242.                         <xs:sequence>
  243.                           <xs:element name="translation" minOccurs="0" maxOccurs="unbounded">
  244.                             <xs:complexType>
  245.                               <xs:simpleContent>
  246.                                 <xs:extension base="xs:normalizedString">
  247.                                   <xs:attribute name="lang" type="xs:language" use="required"/>
  248.                                 </xs:extension>
  249.                               </xs:simpleContent>
  250.                             </xs:complexType>
  251.                           </xs:element> <!-- translation -->
  252.                         </xs:sequence>
  253.                         <xs:attribute name="key" type="xs:ID" use="required">
  254.                           <xs:annotation>
  255.                             <xs:documentation>
  256.                               Usage of type xs:ID instead of xs:string is required by evaluation
  257.                               XSLT stylesheets. 
  258.                               It limits the public/i18n/strings to key-identifier usage instead
  259.                               of original complete english string as key usage. But this is not
  260.                               too bad, because it reduces errors due to changed english strings 
  261.                               in the protected area.
  262.                               The ID type guarantees us uniqueness within public/i18n and allows
  263.                               stylesheets and programs to use XPaths to crossover from a 
  264.                               protected/i18n/string to the corresponding public/i18n/string.
  265.                             </xs:documentation>
  266.                           </xs:annotation>
  267.                         </xs:attribute>
  268.                       </xs:complexType>
  269.                     </xs:element> <!-- string -->
  270.                   </xs:sequence>
  271.                 </xs:complexType>
  272.               </xs:element> <!-- i18n -->
  273.               <xs:element name="upgrade" minOccurs="0" maxOccurs="1">
  274.                 <xs:complexType>
  275.                   <xs:attribute name="url" type="xs:anyURI" use="required"/>
  276.                   <xs:attribute name="release" type="xs:unsignedShort" use="required"/>
  277.                 </xs:complexType>
  278.               </xs:element> <!-- upgrade -->
  279.               <xs:element name="extensions" minOccurs="0" maxOccurs="1">
  280.                 <xs:complexType>
  281.                   <xs:sequence>
  282.                     <xs:any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
  283.                   </xs:sequence>
  284.                 </xs:complexType>
  285.               </xs:element> <!-- extensions -->
  286.             </xs:sequence>
  287.           </xs:complexType>
  288.         </xs:element> <!-- public -->
  289.       </xs:sequence>
  290.     </xs:complexType>
  291.     
  292.     <xs:key name="stringkey">
  293.       <xs:selector xpath="el:protected/el:i18n/el:string"/>
  294.       <xs:field xpath="@el:key"/>
  295.     </xs:key>
  296.     <xs:keyref name="translationkey" refer="el:stringkey">
  297.       <xs:selector xpath="el:public/el:i18n/el:string"/>
  298.       <xs:field xpath="@el:key"/>
  299.     </xs:keyref>
  300.   </xs:element>
  301.   
  302.   <xs:simpleType name="fileType">
  303.     <xs:restriction base="xs:string">
  304.       <xs:enumeration value="level"/>
  305.       <xs:enumeration value="multilevel"/>
  306.       <xs:enumeration value="library"/>
  307.     </xs:restriction>
  308.   </xs:simpleType>
  309.   <xs:simpleType name="revisionType">
  310.     <xs:restriction base="xs:string">
  311.       <xs:pattern value="$Revision[:]?[ ]*[\d]*[ ]*$"/>
  312.     </xs:restriction>
  313.   </xs:simpleType>
  314.   <xs:simpleType name="statusType">
  315.     <xs:restriction base="xs:string">
  316.       <xs:enumeration value="released"/>
  317.       <xs:enumeration value="stable"/>
  318.       <xs:enumeration value="test"/>
  319.       <xs:enumeration value="experimental"/>
  320.     </xs:restriction>
  321.   </xs:simpleType>
  322.   <xs:simpleType name="controlType">
  323.     <xs:restriction base="xs:string">
  324.       <xs:enumeration value="force"/>
  325.       <xs:enumeration value="balance"/>
  326.       <xs:enumeration value="key"/>
  327.       <xs:enumeration value="other"/>
  328.     </xs:restriction>
  329.   </xs:simpleType>
  330.   <xs:simpleType name="scoreunitType">
  331.     <xs:restriction base="xs:string">
  332.       <xs:enumeration value="duration"/>
  333.       <xs:enumeration value="number"/>
  334.     </xs:restriction>
  335.   </xs:simpleType>
  336.   <xs:simpleType name="scoreType">
  337.     <xs:restriction base="xs:string">
  338.       <xs:pattern value="-|([ \d]?\d:[012345]\d)|(\d)+"/>
  339.     </xs:restriction>
  340.   </xs:simpleType>
  341. </xs:schema>
  342.