Schema Chess.xsd


schema location:  D:\ZBrad_D\Projects\chess\XmlChess\Chess.xsd
targetNamespace:  http://www.zbrad.net/XmlChess
 
Elements  Complex types  Simple types 
Games  EndType  PieceType 
GameType  ScoreType 
MoveType  SquaresType 
PlayerType 
TimeControlType 


element Games
diagram
namespace http://www.zbrad.net/XmlChess
children Game
annotation
documentation 
Set of games
source
<xs:element name="Games">
  <xs:annotation>
    <xs:documentation>Set of games</xs:documentation>
  </xs:annotation>
  <xs:complexType>
    <xs:sequence>
      <xs:element name="Game" type="ch:GameType" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>A single game info and move information</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:element>

element Games/Game
diagram
namespace http://www.zbrad.net/XmlChess
type ch:GameType
children Info Moves
annotation
documentation 
A single game info and move information
source
<xs:element name="Game" type="ch:GameType" maxOccurs="unbounded">
  <xs:annotation>
    <xs:documentation>A single game info and move information</xs:documentation>
  </xs:annotation>
</xs:element>

complexType EndType
diagram
namespace http://www.zbrad.net/XmlChess
children Score Text
used by
elements MoveType/Variation/End GameType/Moves/End GameType/Info/Result
annotation
documentation 
A game ending element.
source
<xs:complexType name="EndType">
  <xs:annotation>
    <xs:documentation>A game ending element.</xs:documentation>
  </xs:annotation>
  <xs:sequence>
    <xs:element name="Score" type="ch:ScoreType">
      <xs:annotation>
        <xs:documentation>The score is the result of the game.  It is always one of four possible values: "1-0" (White wins), "0-1" (Black wins), "1/2-1/2" (drawn game), and "*" (game still in progress, game abandoned, or result otherwise unknown).</xs:documentation>
      </xs:annotation>
    </xs:element>
    <xs:element name="Text" minOccurs="0">
      <xs:annotation>
        <xs:documentation>Enumeration of the reasons for the conclusion of the game.  </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="abandoned">
            <xs:annotation>
              <xs:documentation>adandoned game</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="adjudication">
            <xs:annotation>
              <xs:documentation>result due to third party adjudication process</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="death">
            <xs:annotation>
              <xs:documentation>losing player called to greater things, one hopes</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="emergency">
            <xs:annotation>
              <xs:documentation>game concluded due to unforeseen circumstances</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="normal">
            <xs:annotation>
              <xs:documentation>game terminated in a normal fashion</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="rules infraction">
            <xs:annotation>
              <xs:documentation>administrative forgeit due to losing player's failure to observe either the Laws of Chess or the event regulations</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="time forfeit">
            <xs:annotation>
              <xs:documentation>loss due to losing player's failure to meet time control requirements</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="unterminated">
            <xs:annotation>
              <xs:documentation>game not terminated</xs:documentation>
            </xs:annotation>
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
  </xs:sequence>
</xs:complexType>

element EndType/Score
diagram
namespace http://www.zbrad.net/XmlChess
type ch:ScoreType
facets
enumeration 1-0
enumeration 0-1
enumeration 1/2-1/2
enumeration *
annotation
documentation 
The score is the result of the game.  It is always one of four possible values: "1-0" (White wins), "0-1" (Black wins), "1/2-1/2" (drawn game), and "*" (game still in progress, game abandoned, or result otherwise unknown).
source
<xs:element name="Score" type="ch:ScoreType">
  <xs:annotation>
    <xs:documentation>The score is the result of the game.  It is always one of four possible values: "1-0" (White wins), "0-1" (Black wins), "1/2-1/2" (drawn game), and "*" (game still in progress, game abandoned, or result otherwise unknown).</xs:documentation>
  </xs:annotation>
</xs:element>

element EndType/Text
diagram
namespace http://www.zbrad.net/XmlChess
type restriction of xs:string
facets
enumeration abandoned
enumeration adjudication
enumeration death
enumeration emergency
enumeration normal
enumeration rules infraction
enumeration time forfeit
enumeration unterminated
annotation
documentation 
Enumeration of the reasons for the conclusion of the game.  
source
<xs:element name="Text" minOccurs="0">
  <xs:annotation>
    <xs:documentation>Enumeration of the reasons for the conclusion of the game.  </xs:documentation>
  </xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:enumeration value="abandoned">
        <xs:annotation>
          <xs:documentation>adandoned game</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="adjudication">
        <xs:annotation>
          <xs:documentation>result due to third party adjudication process</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="death">
        <xs:annotation>
          <xs:documentation>losing player called to greater things, one hopes</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="emergency">
        <xs:annotation>
          <xs:documentation>game concluded due to unforeseen circumstances</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="normal">
        <xs:annotation>
          <xs:documentation>game terminated in a normal fashion</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="rules infraction">
        <xs:annotation>
          <xs:documentation>administrative forgeit due to losing player's failure to observe either the Laws of Chess or the event regulations</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="time forfeit">
        <xs:annotation>
          <xs:documentation>loss due to losing player's failure to meet time control requirements</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="unterminated">
        <xs:annotation>
          <xs:documentation>game not terminated</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

complexType GameType
diagram
namespace http://www.zbrad.net/XmlChess
children Info Moves
used by
element Games/Game
annotation
documentation 
A single chess game.
source
<xs:complexType name="GameType">
  <xs:annotation>
    <xs:documentation>A single chess game.</xs:documentation>
  </xs:annotation>
  <xs:sequence>
    <xs:element name="Info">
      <xs:annotation>
        <xs:documentation>defines the black and white player contents</xs:documentation>
      </xs:annotation>
      <xs:complexType>
        <xs:sequence>
          <xs:element name="Event">
            <xs:annotation>
              <xs:documentation>Event related information.  At least the name is required.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:all>
                <xs:element name="Name" type="xs:string">
                  <xs:annotation>
                    <xs:documentation>Name of the Event</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Sponsor" type="xs:string" minOccurs="0">
                  <xs:annotation>
                    <xs:documentation>The name of the sponsor of the Event.</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Site" type="xs:string" minOccurs="0">
                  <xs:annotation>
                    <xs:documentation>This includes city and region names along with the IOC standard name for the country.</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Round" minOccurs="0">
                  <xs:annotation>
                    <xs:documentation>The playing round ordinal of the game</xs:documentation>
                  </xs:annotation>
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:pattern value="\d+((\.\d)*)"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:element>
                <xs:element name="Stage" type="xs:string" minOccurs="0">
                  <xs:annotation>
                    <xs:documentation>This is used for the stage of a multi-stage event, such as "preliminary" or "Semifinal".</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Section" type="xs:string" minOccurs="0">
                  <xs:annotation>
                    <xs:documentation>This is used for the playing section of the event, such as "open" or "reserve".</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Board" type="xs:positiveInteger" minOccurs="0">
                  <xs:annotation>
                    <xs:documentation>The board number in a team event or simultaneous exhibition.</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Date" type="xs:date" minOccurs="0">
                  <xs:annotation>
                    <xs:documentation>This is the starting date of the event.</xs:documentation>
                  </xs:annotation>
                </xs:element>
              </xs:all>
            </xs:complexType>
          </xs:element>
          <xs:element name="Date" type="xs:date" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Starting date of the game.  Note this is not necessarily the same of the starting date of the event.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="White">
            <xs:annotation>
              <xs:documentation>List of White player or players.  At least 1 player is required.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Player" type="ch:PlayerType" maxOccurs="unbounded">
                  <xs:annotation>
                    <xs:documentation>White player information</xs:documentation>
                  </xs:annotation>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="Black">
            <xs:annotation>
              <xs:documentation>List of Black player or players.  At least 1 player is required.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Player" type="ch:PlayerType" maxOccurs="unbounded">
                  <xs:annotation>
                    <xs:documentation>Black player information</xs:documentation>
                  </xs:annotation>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="Result" type="ch:EndType"/>
          <xs:element name="Opening" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Opening information is optional.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Name" type="xs:string">
                  <xs:annotation>
                    <xs:documentation>The name of the opening</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Variation" type="xs:string" minOccurs="0">
                  <xs:annotation>
                    <xs:documentation>A major variation of the opening</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Eco" minOccurs="0">
                  <xs:annotation>
                    <xs:documentation>The Encyclopedia of Chess Openings code.  Form is Xdd where X is A-E, and dd is 2 digits.</xs:documentation>
                  </xs:annotation>
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:pattern value="[A-E]\d\d"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:element>
                <xs:element name="Nic" type="xs:string" minOccurs="0">
                  <xs:annotation>
                    <xs:documentation>The New in Chess code.</xs:documentation>
                  </xs:annotation>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="TimeControl" minOccurs="0">
            <xs:annotation>
              <xs:documentation>The types of time controls are: Elapsed, Incremental, SandClock.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:choice>
                <xs:element name="Other" type="xs:string"/>
                <xs:element name="Elapsed">
                  <xs:annotation>
                    <xs:documentation>This is the list of Time Controls used for this game.  Usually there is more than 1, except for blitz games.</xs:documentation>
                  </xs:annotation>
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="Control" type="ch:TimeControlType" maxOccurs="unbounded">
                        <xs:annotation>
                          <xs:documentation>A specified Time Control for a period</xs:documentation>
                        </xs:annotation>
                      </xs:element>
                    </xs:sequence>
                  </xs:complexType>
                </xs:element>
                <xs:element name="Incremental">
                  <xs:annotation>
                    <xs:documentation>An incremental time period, where an initial time allocation is provided, and then additional time is added for each move.</xs:documentation>
                  </xs:annotation>
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="Time">
                        <xs:annotation>
                          <xs:documentation>The initial number of minutes or seconds allocated for the period.</xs:documentation>
                        </xs:annotation>
                        <xs:complexType>
                          <xs:choice>
                            <xs:element name="Minutes" type="xs:positiveInteger">
                              <xs:annotation>
                                <xs:documentation>The initial number of minutes allocated.</xs:documentation>
                              </xs:annotation>
                            </xs:element>
                            <xs:element name="Seconds" type="xs:positiveInteger">
                              <xs:annotation>
                                <xs:documentation>The initial number of seconds allocated.</xs:documentation>
                              </xs:annotation>
                            </xs:element>
                          </xs:choice>
                        </xs:complexType>
                      </xs:element>
                      <xs:element name="Increment" type="xs:positiveInteger">
                        <xs:annotation>
                          <xs:documentation>The number of extra seconds added after each move is made.</xs:documentation>
                        </xs:annotation>
                      </xs:element>
                    </xs:sequence>
                  </xs:complexType>
                </xs:element>
                <xs:element name="SandClock" type="xs:positiveInteger">
                  <xs:annotation>
                    <xs:documentation>A SandClock, also called Hourglass.  The time control is implemented as if a sandclock were set at the start of the period with an equal amount of sand in each of the two chambers and the players invert the sandclock after each move with a time forfeit indicated by an empty upper chamber.  The time is specified in seconds.</xs:documentation>
                  </xs:annotation>
                </xs:element>
              </xs:choice>
            </xs:complexType>
          </xs:element>
          <xs:element name="Annotator" type="xs:string" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Identifies the annotator or annotators of the game.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="Mode" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Gives the playing mode of the game.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="Over the board"/>
                <xs:enumeration value="Paper mail"/>
                <xs:enumeration value="Electronic mail"/>
                <xs:enumeration value="Internet Chess Server"/>
                <xs:enumeration value="General telecommunication"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:element>
          <xs:element name="PlyCount" type="xs:positiveInteger" minOccurs="0">
            <xs:annotation>
              <xs:documentation>Gives the number of ply (moves) in the game.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="Fen" minOccurs="0">
            <xs:annotation>
              <xs:documentation>A description of initial board position in Forsyth-Edwards Notation.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:element name="ActiveColor">
                  <xs:annotation>
                    <xs:documentation>An enumeration of the color that is on move: white or black.</xs:documentation>
                  </xs:annotation>
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:enumeration value="white"/>
                      <xs:enumeration value="black"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:element>
                <xs:element name="CastlingAvailability">
                  <xs:annotation>
                    <xs:documentation>Enumeration of the available castling square KQ for white Kingside/Queenside, kq for black Kingside/Queenside.</xs:documentation>
                  </xs:annotation>
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:enumeration value="KQkq"/>
                      <xs:enumeration value="KQk"/>
                      <xs:enumeration value="KQq"/>
                      <xs:enumeration value="KQ"/>
                      <xs:enumeration value="Kkq"/>
                      <xs:enumeration value="Kq"/>
                      <xs:enumeration value="Kk"/>
                      <xs:enumeration value="K"/>
                      <xs:enumeration value="Qkq"/>
                      <xs:enumeration value="Qq"/>
                      <xs:enumeration value="Qk"/>
                      <xs:enumeration value="Q"/>
                      <xs:enumeration value="kq"/>
                      <xs:enumeration value="q"/>
                      <xs:enumeration value="k"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:element>
                <xs:element name="EnPassantTargetSquare" minOccurs="0">
                  <xs:annotation>
                    <xs:documentation>The target square, if any, of an EnPassant capture.</xs:documentation>
                  </xs:annotation>
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:enumeration value="a3"/>
                      <xs:enumeration value="b3"/>
                      <xs:enumeration value="c3"/>
                      <xs:enumeration value="d3"/>
                      <xs:enumeration value="e3"/>
                      <xs:enumeration value="f3"/>
                      <xs:enumeration value="g3"/>
                      <xs:enumeration value="h3"/>
                      <xs:enumeration value="a6"/>
                      <xs:enumeration value="b6"/>
                      <xs:enumeration value="c6"/>
                      <xs:enumeration value="d6"/>
                      <xs:enumeration value="e6"/>
                      <xs:enumeration value="f6"/>
                      <xs:enumeration value="g6"/>
                      <xs:enumeration value="h6"/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:element>
                <xs:element name="DrawCount" type="xs:positiveInteger">
                  <xs:annotation>
                    <xs:documentation>This represents the halfmove  clock.  The number is the count of halfmove (or ply) since the last pawn advance or capturing move.  The value is used for the fifty move draw rule.</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="MoveCount" type="xs:positiveInteger">
                  <xs:annotation>
                    <xs:documentation>The halfmove ply count.</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="Layout">
                  <xs:annotation>
                    <xs:documentation>A description of the board contents, encoded in Forsyth  notation.   White pieces are identified by uppercase piece letter ("PNBRQK").  Black pieces are identified by lowercase piece letter ("pnbrqk").  Empty squares are represented by digits 1 though 8, and a slash ('/') is used to seperate data of adjacent ranks.</xs:documentation>
                  </xs:annotation>
                  <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:pattern value="[prnbqkPRNBQK12345678/]+"/>
                    </xs:restriction>
                  </xs:simpleType>