<?xml version="1.0"?>
<!-- 
   ____________________________________________________________________________  
  |                                                                            |
  |    VERSION:   This version 0.4 of the ChessMLite Document type definition  |
  |                                                                            |
  |   REV-DATE:   19.06.00                                                     |
  |____________________________________________________________________________|
  
-->

<!ENTITY % entities     SYSTEM "chessmlite.ent"> <!-- 190600 -->
<!ENTITY % person       SYSTEM "person.mod">
<!ENTITY % game         SYSTEM "game.mod">
<!ENTITY % move         SYSTEM "move.mod">
<!ENTITY % problem      SYSTEM "problem.mod">
<!ENTITY % references   SYSTEM "references.mod">
<!ENTITY % event        SYSTEM "event.mod">

<!ENTITY % lite          'INCLUDE'>
<!ENTITY % full          'IGNORE'>
<!ENTITY % non-lite-cgml 'IGNORE'>


<!ENTITY % title        "title         NMTOKENS  #IMPLIED">
<!ENTITY % annotator    "annotator     NMTOKENS  #IMPLIED">
<!ENTITY % author       "author        NMTOKENS  #IMPLIED">
<!ENTITY % result       "result        CDATA     #IMPLIED">
<!ENTITY % id           "id            ID        #IMPLIED">
<!ENTITY % type         "type          NMTOKEN   #IMPLIED"> 
<!ENTITY % lang         "lang          CDATA     #IMPLIED">
<!ENTITY % supplemental "(text|event|references)*">  		<!--1806000-->




<!ELEMENT  person      	(#PCDATA|name)*>
<!ATTLIST  person  	pid		CDATA 		#IMPLIED> 		<!--1806000-->

	
<!ELEMENT  co           (name|(input?,output?))>
<!ATTLIST  co		checked	  	CDATA		#IMPLIED
			role		CDATA		#IMPLIED
			program	  	CDATA		#IMPLIED
			version	  	CDATA		#IMPLIED
			date	  	CDATA		#IMPLIED
			operator  	CDATA		#IMPLIED
			hinv	  	CDATA		#IMPLIED
			time	  	CDATA		#IMPLIED
			pid		CDATA 		#IMPLIED>		<!--180600--> 
<!ELEMENT  input  (#PCDATA)>
<!ELEMENT  output (#PCDATA)>
		

<!ELEMENT  name	        (#PCDATA)*>
<!ATTLIST  name         firstname   	NMTOKENS        #IMPLIED
                        lastname   	NMTOKENS        #IMPLIED> 		<!--1806000-->



<!-- all chessgame tags are defined, no reference to other mod -->


<!ELEMENT  chessgame    (head?,body?)>
<!ATTLIST  chessgame 	white	        IDREFS	        #IMPLIED
        		black           IDREFS          #IMPLIED
                        %result;
        		%id;>       

<!ELEMENT  white        (#PCDATA)>
<!ATTLIST  white        %id; 
                        %title;
                        rating          CDATA           #IMPLIED   
                        eventtotal      CDATA           #IMPLIED
                        ratingtype      CDATA           #IMPLIED
                        player          IDREFS          #IMPLIED>  

<!ELEMENT  black	(#PCDATA)>
<!ATTLIST  black        %id;
                        %title; 
                        rating          CDATA           #IMPLIED
                        ratingtype      CDATA           #IMPLIED
                        player          IDREFS          #IMPLIED>  


<!-- CHESSML -->





<!-- CHESSMLITE -->



<!ELEMENT  classification (#PCDATA)>

<!ELEMENT  setup        (#PCDATA)> 	

<!ELEMENT  moves        (#PCDATA)>



<!ELEMENT  text         (#PCDATA)>
<!ATTLIST  text         %annotator;
                        %lang;>

<!ELEMENT  chessproblem (head?, body?)>
<!ATTLIST  chessproblem %id;
                        %annotator;
                        %lang;
                        event           IDREF           #IMPLIED
                        type            NMTOKEN         "original">

<!ELEMENT  dedication   (#PCDATA)>
<!ATTLIST  dedication   to          	IDREFS          #IMPLIED>
<!ELEMENT  stipulation  (#PCDATA)>
<!ATTLIST  stipulation  %type;
                        moves   	CDATA           #IMPLIED
                        tries           CDATA	        #IMPLIED
			set             CDATA           #IMPLIED
			definition	IDREF		#IMPLIED
                        tree            CDATA           #IMPLIED
			mode		CDATA		"add">			<!-- 210600 -->
<!ELEMENT  condition    (#PCDATA)>
<!ATTLIST  condition    %type; 
                        %id;
			definition	IDREF		#IMPLIED
			mode		CDATA		"add">   		<!-- 180600 -->
<!ELEMENT  twin         ((setup|stipulation|condition)+, (solution|theme))*>	<!-- 180600 -->
<!ATTLIST  twin         %id;>






<!ELEMENT  solution     (#PCDATA|co|moves)*>
<!ATTLIST  solution     
                        twin    	IDREF           #IMPLIED
                        %annotator; 
                        %id;
                        %lang;
                        phase    	NMTOKENS 	"authors solution"
                        num     	CDATA           #IMPLIED>


<!ELEMENT  theme        (#PCDATA)*>
<!ATTLIST  theme        %id;
                        %lang;
                        %annotator;
                        problem   	IDREFS        #IMPLIED
                        solution  	IDREFS        #IMPLIED
                        original  	IDREF         #IMPLIED
                        author    	IDREFS        #IMPLIED
			category  	NMTOKENS      #IMPLIED
                        twin      	IDREF         #IMPLIED>



<!-- This file contains the information on all the tags important for the representation of references -->


<!ELEMENT  date		EMPTY>
<!ATTLIST  date         year            CDATA           #REQUIRED
                        month           CDATA           #IMPLIED
                        day             CDATA           #IMPLIED
			type		CDATA           "AD"
			time		CDATA		#IMPLIED
   			timezone	CDATA		#IMPLIED>	<!--180600--> 

<!ELEMENT  author       (#PCDATA|person|co)*>
<!ATTLIST  author 	firstname       CDATA           #IMPLIED
                        lastname        CDATA           #IMPLIED
                        initial         CDATA           #IMPLIED
                        type            NMTOKENS        #IMPLIED             
                        title           NMTOKENS        #IMPLIED
        		%id;>


<!ELEMENT  references   (source)*>       





<!ELEMENT  source       (#PCDATA|date|author)*> <!-- 150600 --> <!--190600--> 
<!ATTLIST  source       type            CDATA           #IMPLIED
                        id              ID              #REQUIRED
                        idtype          CDATA           #IMPLIED
                        xlink           CDATA           #IMPLIED
			copyright       NMTOKENS	#IMPLIED      
                        lang            CDATA           #IMPLIED
                        edition         CDATA           #IMPLIED
                        revision        CDATA           #IMPLIED
                        code            CDATA           #IMPLIED
                        codetype        NMTOKEN         #IMPLIED
                        sourcename      CDATA           #IMPLIED> 	<!--180600--> 




<!ELEMENT  event	(#PCDATA|participant|person)*>  	<!--180600--> 
<!ATTLIST  event	name            NMTOKENS    	#REQUIRED
                        category        CDATA           #IMPLIED  
                        organization    NMTOKEN         "FIDE"  
                        participants-no CDATA           #IMPLIED
                        date            CDATA           #IMPLIED
                        round           CDATA           #IMPLIED
			roundtotal      CDATA		#IMPLIED
        		num	        CDATA  	        #IMPLIED
                        %type;>
<!ELEMENT  participant	(#PCDATA|person|co)*>   			<!--180600--> 
<!ATTLIST  participant 	%id;
                        eventtotal      CDATA           #IMPLIED>


<!ELEMENT  chessml	(%supplemental; , (chessgame|chessproblem)*)>  		<!--1806000-->
<!ATTLIST  chessml                              
           %author;
           %lang;
           %title;       
           %id;             
           generator       NMTOKENS        #IMPLIED 
           lastmod         CDATA           #IMPLIED
           version         CDATA           #FIXED "0.4" 
           level           CDATA           #FIXED "0">

<!ELEMENT  head	(((white,black)|(author)+), date?, dedication?)> 
<!ATTLIST  head         source          IDREFS          #IMPLIED        
                        section         CDATA           #IMPLIED
                        stage           NMTOKEN         #IMPLIED 
                        boardnum        CDATA           #IMPLIED
                        lastmod         CDATA           #IMPLIED
                        time            CDATA           #IMPLIED
                        event           ID              #IMPLIED
        		%annotator;
                        copyright       CDATA           #IMPLIED>                     
                        
<!ELEMENT  body         (setup?,classification?,((moves)*|(stipulation|condition|twin|solution|theme)*))>
<!ATTLIST  body 	%lang;	
                        ply-count       CDATA           #IMPLIED
                        type            CDATA           #IMPLIED> 
