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

<!-- importing the modules -->

<!ENTITY % entities     SYSTEM "cpml.ent">
<!ENTITY % person       SYSTEM "person.mod">
<!ENTITY % move         SYSTEM "move.mod">
<!ENTITY % problem      SYSTEM "problem.mod">
<!ENTITY % references   SYSTEM "references.mod">
<!ENTITY % definitions  SYSTEM "definitions.mod">
<!ENTITY % event        SYSTEM "event.mod">
<!ENTITY % notation     SYSTEM "notation.mod">

<!ENTITY % full          'INCLUDE'>
<!ENTITY % non-lite-cgml 'INCLUDE'>
<!ENTITY % lite          '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|definition)*">  		<!--1806000-->


<!ENTITY % COLUMN.A  "a1|a2|a3|a4|a5|a6|a7|a8"> <!ENTITY % COLUMN.B  "b1|b2|b3|b4|b5|b6|b7|b8">
<!ENTITY % COLUMN.C  "c1|c2|c3|c4|c5|c6|c7|c8"> <!ENTITY % COLUMN.D  "d1|d2|d3|d4|d5|d6|d7|d8">
<!ENTITY % COLUMN.E  "e1|e2|e3|e4|e5|e6|e7|e8"> <!ENTITY % COLUMN.F  "f1|f2|f3|f4|f5|f6|f7|f8">
<!ENTITY % COLUMN.G  "g1|g2|g3|g4|g5|g6|g7|g8"> <!ENTITY % COLUMN.H  "h1|h2|h3|h4|h5|h6|h7|h8">

<!ENTITY % squares   "sq|%COLUMN.A;|%COLUMN.B;|%COLUMN.C;|%COLUMN.D;|%COLUMN.E;|%COLUMN.F;|%COLUMN.G;|%COLUMN.H;">
<!ENTITY % pieces    "K|Q|R|B|N|P">   						<!-- 150600 -->


<!ELEMENT  person      	(name,alias*,bio?)>
<!ATTLIST  person  	role		CDATA		#IMPLIED
			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-->


<!ELEMENT  alias        (name)*>                                
<!ELEMENT  bio          (#PCDATA|analysis)*>
<!ATTLIST  bio          nationality     CDATA           #IMPLIED
                        birthday        CDATA           #IMPLIED
                        birthplace   	CDATA           #IMPLIED
                        deathday	CDATA           #IMPLIED
                        deathplace      CDATA           #IMPLIED
			%lang;
			adress		CDATA		#IMPLIED
			title		CDATA		#IMPLIED>		<!--180600--> 


<!-- CHESSML -->



<!ELEMENT  classification (#PCDATA)>
<!ATTLIST  classification 
			type    	CDATA		#IMPLIED
                        name            NMTOKENS        #IMPLIED
			key		IDREF		#IMPLIED
                        subkey          IDREF           #IMPLIED
			keylist		IDREF		#IMPLIED>  	<!-- 150600 -->
<!ELEMENT  setup        (position?,fen?)> 				<!-- 180600 -->
<!ELEMENT  fen          (#PCDATA)>
<!ATTLIST  fen 		castle 	        NMTOKENS        #IMPLIED
        		ep 	        NMTOKENS        #IMPLIED
        		party           CDATA           #IMPLIED
                        %lang;
                        extended        (yes|no)        "no">   
<!ELEMENT  position     (#PCDATA|board|piecelist)*>			<!-- 180600 -->
<!ELEMENT  piecelist	(#PCDATA|piece)*>
<!ATTLIST  piecelist	color		CDATA		#REQUIRED
			notationtype    NMTOKEN         "SAN">	        <!-- 180600 -->
<!ELEMENT  piece        (%squares;)*>
<!ATTLIST  piece        square          CDATA           #IMPLIED
                        name            CDATA         	#IMPLIED
                        abbrevation     CDATA           #REQUIRED
			color		CDATA           #REQUIRED
			def		IDREF		#IMPLIED
			mode		CDATA		"add">	        <!-- 180600 -->
<!ELEMENT  moves	(#PCDATA|moves|analysis|m|referto)*> 
<!ATTLIST  moves        ply	        CDATA           #IMPLIED 
        		party           CDATA           #REQUIRED
                        type            CDATA           "mainline"                        
                        position        IDREF           #IMPLIED
        	        %id;
                        notationtype    NMTOKEN         "SAN">   
<!ELEMENT  m	        (#PCDATA|%pieces;|%squares;|comment|referto)*> 
<!ATTLIST  m     	from 	        CDATA           #IMPLIED
                        id              ID              #IMPLIED
                        analysis        IDREF           #IMPLIED
        		to   	        CDATA           #IMPLIED
        		piece	        NMTOKEN         #IMPLIED
        		action	        NMTOKENS        #IMPLIED  
        	        ply	        CDATA           #IMPLIED
			value           CDATA		#IMPLIED
        		party           CDATA           #IMPLIED> 
<!ELEMENT  comment      EMPTY>
<!ATTLIST  comment      style           CDATA           "informant"
                        value           CDATA           #REQUIRED>
<!ELEMENT  K   EMPTY> <!ELEMENT  Q   EMPTY>
<!ELEMENT  R   EMPTY> <!ELEMENT  N   EMPTY>
<!ELEMENT  B   EMPTY> <!ELEMENT  P   EMPTY>
<!ELEMENT  a1  EMPTY> <!ELEMENT  a2  EMPTY> <!ELEMENT  a3  EMPTY> <!ELEMENT  a4  EMPTY>
<!ELEMENT  a5  EMPTY> <!ELEMENT  a6  EMPTY> <!ELEMENT  a7  EMPTY> <!ELEMENT  a8  EMPTY>
<!ELEMENT  b1  EMPTY> <!ELEMENT  b2  EMPTY> <!ELEMENT  b3  EMPTY> <!ELEMENT  b4  EMPTY>
<!ELEMENT  b5  EMPTY> <!ELEMENT  b6  EMPTY> <!ELEMENT  b7  EMPTY> <!ELEMENT  b8  EMPTY>
<!ELEMENT  c1  EMPTY> <!ELEMENT  c2  EMPTY> <!ELEMENT  c3  EMPTY> <!ELEMENT  c4  EMPTY>
<!ELEMENT  c5  EMPTY> <!ELEMENT  c6  EMPTY> <!ELEMENT  c7  EMPTY> <!ELEMENT  c8  EMPTY>
<!ELEMENT  d1  EMPTY> <!ELEMENT  d2  EMPTY> <!ELEMENT  d3  EMPTY> <!ELEMENT  d4  EMPTY>
<!ELEMENT  d5  EMPTY> <!ELEMENT  d6  EMPTY> <!ELEMENT  d7  EMPTY> <!ELEMENT  d8  EMPTY>
<!ELEMENT  e1  EMPTY> <!ELEMENT  e2  EMPTY> <!ELEMENT  e3  EMPTY> <!ELEMENT  e4  EMPTY>
<!ELEMENT  e5  EMPTY> <!ELEMENT  e6  EMPTY> <!ELEMENT  e7  EMPTY> <!ELEMENT  e8  EMPTY>
<!ELEMENT  f1  EMPTY> <!ELEMENT  f2  EMPTY> <!ELEMENT  f3  EMPTY> <!ELEMENT  f4  EMPTY>
<!ELEMENT  f5  EMPTY> <!ELEMENT  f6  EMPTY> <!ELEMENT  f7  EMPTY> <!ELEMENT  f8  EMPTY>
<!ELEMENT  g1  EMPTY> <!ELEMENT  g2  EMPTY> <!ELEMENT  g3  EMPTY> <!ELEMENT  g4  EMPTY>
<!ELEMENT  g5  EMPTY> <!ELEMENT  g6  EMPTY> <!ELEMENT  g7  EMPTY> <!ELEMENT  g8  EMPTY>
<!ELEMENT  h1  EMPTY> <!ELEMENT  h2  EMPTY> <!ELEMENT  h3  EMPTY> <!ELEMENT  h4  EMPTY>
<!ELEMENT  h5  EMPTY> <!ELEMENT  h6  EMPTY> <!ELEMENT  h7  EMPTY> <!ELEMENT  h8  EMPTY>

<!ELEMENT  analysis     (text|moves|fen|pgn|diagram|referto)*>                                   
<!ATTLIST  analysis     %annotator;  
                        %id;
                        compareto      	IDREF           #IMPLIED
                        m               IDREF           #IMPLIED> 		<!--180600-->
<!ELEMENT  pgn          (#PCDATA)>   
<!ATTLIST  pgn          lang            CDATA           #IMPLIED>  	<!-- 150600 -->
<!ELEMENT  diagram      (#PCDATA|fen|position)*> 
<!ATTLIST  diagram 	%title;
                        m               IDREF           #IMPLIED
                        moves           IDREF           #IMPLIED
			outputtype (image|none|text)    "image"
                        %id;>        
<!ELEMENT  board	(#PCDATA|fen)*>
<!ATTLIST  board	dim             CDATA           "2"
                        topology        CDATA           #IMPLIED
                        coord-numbering	NMTOKENS        #IMPLIED>	<!-- 180600 -->
<!ELEMENT  referto      (#PCDATA)>					<!--190600--> 
<!ATTLIST  referto      reference       IDREF           #IMPLIED
                        referencetyp    NMTOKEN         #IMPLIED
                        refpoint        CDATA           #IMPLIED>  	<!--190600-->



<!ELEMENT  sq  (coord)+>
<!ELEMENT  coord        EMPTY>
<!ATTLIST  coord        direction       CDATA           #REQUIRED
                        n               CDATA           #REQUIRED>


<!-- CHESSMLITE -->



<!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|analysis|moves|m)*>
<!ATTLIST  solution     
                        twin    	IDREF           #IMPLIED
                        %annotator; 
                        %id;
                        %lang;
                        phase    	NMTOKENS 	"authors solution"
                        num     	CDATA           #IMPLIED>
<!ELEMENT  theme        (#PCDATA|schema)*>
<!ATTLIST  theme        %id;
                        %lang;
                        %annotator;
                        problem   	IDREFS        #IMPLIED
                        solution  	IDREFS        #IMPLIED
                        original  	IDREF         #IMPLIED
                        author    	IDREFS        #IMPLIED
			category  	NMTOKENS      #IMPLIED                                
                        twin      	IDREF         #IMPLIED>
<!ELEMENT  schema       (moves|m)+>






<!-- 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|publisher|copyright|part|chapter|section|list|author|issue)*> <!-- 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  copyright	(#PCDATA|date)*>				<!--180600--> 
<!ATTLIST  copyright	type		CDATA		#IMPLIED
			validity-region CDATA		#IMPLIED
			holder		CDATA		#IMPLIED>   	<!--180600--> 

<!ELEMENT  issue        (#PCDATA|date|author|part|section|chapter)*> 	<!--080600--> 
<!ATTLIST  issue        id              ID              #REQUIRED
                        nr              CDATA           #IMPLIED>      


<!ELEMENT  part         (#PCDATA|chapter|list)*>
<!ATTLIST  part         id              ID              #REQUIRED
                        author          IDREF           #IMPLIED
			title		NMTOKENS        #IMPLIED
			xlink		CDATA           #IMPLIED
                        %lang;
                        type            NMTOKENS        #IMPLIED
                        startpage       NMTOKEN         #IMPLIED
                        endpage         NMTOKEN         #IMPLIED>  	<!--150600--> <!--180600--> 

<!ELEMENT  chapter      (#PCDATA|section|list)*>
<!ATTLIST  chapter      id              ID              #REQUIRED
                        author          IDREF           #IMPLIED
                        %lang;
			title		NMTOKENS        #IMPLIED
			xlink		CDATA           #IMPLIED
                        startpage       NMTOKEN         #IMPLIED
                        endpage         NMTOKEN         #IMPLIED>  	<!--150600--> <!--180600-->   

<!ELEMENT  section      (#PCDATA|subsection|list)*>
<!ATTLIST  section      id              ID              #REQUIRED
                        author          IDREF           #IMPLIED
			title		NMTOKENS        #IMPLIED
			xlink		CDATA           #IMPLIED
                        %lang;
                        startpage       NMTOKEN         #IMPLIED
                        endpage         NMTOKEN         #IMPLIED>  	<!--150600--> <!--180600--> 

<!ELEMENT  subsection   (#PCDATA|subsection|list)*>			<!--180600--> 
<!ATTLIST  subsection   id              ID              #REQUIRED
                        author          IDREF           #IMPLIED
			title		NMTOKENS        #IMPLIED
			xlink		CDATA           #IMPLIED
                        %lang;
			level		CDATA		#IMPLIED
                        startpage       NMTOKEN         #IMPLIED
                        endpage         NMTOKEN         #IMPLIED>  	<!--150600--> <!--180600--> 

<!ELEMENT  list         (listitem)*>
<!ATTLIST  list         name            NMTOKEN         #IMPLIED
			title		CDATA 		#IMPLIED
                        listid          ID              #IMPLIED
                        length          CDATA           #IMPLIED
                        ordertype       CDATA           "ordered"
                        indextype       CDATA           "numbers"           
                        description     CDATA           #IMPLIED>  	<!--150600--> <!--180600--> 

<!ELEMENT  listitem     (#PCDATA|list)*>
<!ATTLIST  listitem     content         IDREF           #IMPLIED
                        number          CDATA           #IMPLIED
                        itemid          ID              #IMPLIED>  	<!--150600-->
                       

<!ELEMENT  publisher    (#PCDATA)>
<!ATTLIST  publisher    country         NMTOKENS        #IMPLIED
                        state           NMTOKENS        #IMPLIED
                        town            NMTOKENS        #IMPLIED
                        location        NMTOKENS        #IMPLIED
                        street          NMTOKENS        #IMPLIED
                        type            NMTOKENS        #IMPLIED
                        %id;
                        %lang;>








<!ELEMENT  definition   (defname+, (var*|(inventor*, description+, rule*)))>
<!ATTLIST  definition   defclass        NMTOKEN         #REQUIRED
                        example         IDREFS          #IMPLIED
                        type            CDATA           #IMPLIED  
                        id              ID              #IMPLIED
                        group           CDATA           #IMPLIED
                        src             IDREFS          #IMPLIED
                        class           (yes|no)        "no"
                        originalsrc     IDREF           #IMPLIED
                        publishingdate  CDATA           #IMPLIED>    
<!ELEMENT  defname      (#PCDATA)>                                   
<!ATTLIST  defname      lang            CDATA           #IMPLIED
                        var             IDREFS          #IMPLIED
                        src             IDREFS          #IMPLIED>     

<!ELEMENT  var          (inventor*, description+, rule*)>              
<!ATTLIST  var          id              ID              #REQUIRED
                        example         IDREFS          #IMPLIED
                        type            CDATA           #IMPLIED
                        group           CDATA           #IMPLIED
                        src             IDREFS          #IMPLIED
                        class           (yes|no)        "no"
                        originalsrc     IDREF           #IMPLIED
                        publishingdate  CDATA           #IMPLIED>       <!--180600-->

<!ELEMENT  inventor     (#PCDATA)>                                    
<!ATTLIST  inventor     src             IDREFS          #IMPLIED
                        person          IDREF           #IMPLIED>       <!--180600-->    

<!ELEMENT  description  (#PCDATA|analysis)*>
<!ATTLIST  description  lang            CDATA           #IMPLIED 
                        src             IDREFS          #IMPLIED>

<!ELEMENT  rule         (#PCDATA|analysis)*>
<!ATTLIST  rule         type            CDATA           #IMPLIED 
                        src             IDREFS          #IMPLIED>       <!--180600-->   



<!ELEMENT  event	(#PCDATA|mode|location|participant|person|results)*>  	<!--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  location     (#PCDATA)>
<!ATTLIST  location     country         NMTOKENS        #IMPLIED 
                        city            NMTOKENS        #IMPLIED   
                        street          NMTOKENS        #IMPLIED   
                        type            NMTOKENS        #IMPLIED>
  
<!ELEMENT mode          EMPTY>
<!ATTLIST mode          matchmode       CDATA           #IMPLIED
                        termination     NMTOKEN         #IMPLIED 
                        timecontrol     NMTOKENS        #IMPLIED>

<!ELEMENT results	(#PCDATA|list)*>				<!--190600--> 

<!ELEMENT award         (#PCDATA)>
<!ATTLIST award         type            CDATA           #IMPLIED
                        points          CDATA           #IMPLIED   
                        rank            CDATA           #IMPLIED
                        price           NMTOKENS        #IMPLIED
                        sponsor         IDREFS          #IMPLIED
			rating		CDATA		#IMPLIED
			recipient	IDREF		#IMPLIED> 	<!--210600-->   

<!ELEMENT  participant	(#PCDATA|person|co)*>   			<!--180600--> 
<!ATTLIST  participant 	%id;
                        eventtotal      CDATA           #IMPLIED>




<!NOTATION PGN   PUBLIC "-//S.J.Edwards//NOTATION Portable Game Notation//EN">                                 
<!NOTATION FEN   PUBLIC "-//S.J.Edwards//NOTATION Forsyth Edwards Notation//EN">      
<!NOTATION EPD   PUBLIC "-//S.J.Edwards//NOTATION Extended Position Description//EN">                         
<!NOTATION XFEN  PUBLIC "-//O.Sick//NOTATION      Extended Forsyth Edwards Notation//EN">
<!NOTATION PY    PUBLIC "-//Popeye//NOTATION      Popeye chess problem solving program//DE">     
<!NOTATION CBF   PUBLIC "-//Chessbase//NOTATION   Chessbase Game File //EN">


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

<!ELEMENT  head	((author)+, mode?, award*, 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?,(stipulation|condition|twin|solution|theme)*)>
<!ATTLIST  body 	%lang;	
                        ply-count       CDATA           #IMPLIED
                        type            CDATA           #IMPLIED> 


