CIF Schema
XML schema definition of CIF
This document is describing the XML format of CIF with the use of XML schema (XSD). This format is the basis for the binary format CCIF. Note that XSD is not sufficient for a complete formal description, so some important aspects of this format, especially the move section format, will be described outside of XSD with the use of Backus-Naur Form.
The root element
The root element cif contains the obligatory element info always as the last element – this means that this element is always at the end of the file. This guarantees that writing or updating an archive are performant, this information section has to be updated after each modification. The C/CIF reader will read this information section before parsing the other elements, so in this way the application can make a preliminary decision whether this archive contains games of interest.
The root element cif contains any number of games, documents, data sections, namebase sections, or index sections. Element document is escpecially defined for application ChessBase, because in ChessBase a database index consists of interleaved games and documents. Element data is intended to hold some archive specific data not related to any game, for example images serving as icons for this archive.
An overview of the C/CIF archive structure
For the overview we will use the EBNF notation. Note that the XML schema is more exact than the EBNF description.
Here is a more structured, but informal description: