HOME XML-SCHEMA XML-EXAMPLES CHESS VARIANTS FBR MBN ANCP FAQ RESOURCES ABOUT

CIF - Basic Types - Comment


<xs:complexType name="Comment"> <xs:sequence minOccurs="1" maxOccurs="unbounded"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="lang" type="xs:language" default=""/> <xs:attribute name="format" type="TextFormat" default="plain"/> </xs:extension> </xs:simpleContent> </xs:sequence> </xs:complexType> <xs:simpleType name="TextFormat"> <xs:restriction base="xs:string"> <xs:enumeration value="plain"/> <xs:enumeration value="html"/> <xs:enumeration value="xml"/> </xs:restriction> </xs:simpleType>

The optional language attribute will be given as an ISO 639-1 code. If this is not possible the code may be given as an ISO 639-2 code, in this case the terminology code has to be used. See Alpha-3 codes for a list of language codes. If no language code is given it will be assumed that this comment is language independent, it will not be assumed that the default language is English. Note that the language code will be given in lowercase. There is one exceptional value: lang="*". This value means that the language code is unknown, but it is not a language independent comment. This special value is especially required for the decoding of PGN archives to C/CIF, because PGN does not know about the existence of the various languages, this means that the language inside comments in PGN is in general unknown.

A comment either contains plain text, HTML formatted text (HTML will not be explained here), or XML formatted text. If the text is XML formatted the content of Comment should fit the following type XMLContent:

<xs:complexType name="XMLContent" mixed="true"> <xs:all> <xs:element name="b" type="XMLContent"/> <xs:element name="u" type="XMLContent"/> <xs:element name="i" type="XMLContent"/> <xs:element name="a" type="XMLContent"/> <xs:element name="nag" type="NAG"/> <xs:element name="sym" type="Piece"/> <xs:element name="emo" type="Emoticon"/> <xs:element name="phr" type="Phrase"/> <xs:element name="msg" type="Message"/> <xs:any/> </xs:all> </xs:complexType>

The elements b, i, u, and a are known from HTML. The first column contains the XML syntax, the second column contains the equivalent HTML syntax, and the third columns shows how the display is intended:

<b>Bold</b> <b>Bold</b> Bold
<i>Italic</i> <i>Italic</i> Italic
<u>Underlined</u> <u>Underlined</u> Underlined
<a>http://ccif.sf.net</a> <a href="http://ccif.sf.net">ccif.sf.net</a> ccif.sf.net
<a>http://ccif.sf.net|C/CIF</a> <a href="http://ccif.sf.net">C/CIF</a> C/CIF

<xs:simpleType name="Piece"> <xs:restriction base="xs:string"> <xs:length value="1"/> </xs:restriction> </xs:simpleType>

Piece must belong to the piece set given in attribute pieceset in element game. The application might show this symbol inside the comment graphical. Example: <sym>K</sym> might be shown as "♔".

<xs:simpleType name="Emoticon"> <xs:restriction base="xs:string"> <xs:pattern value="[^\s]+"/> </xs:restriction> </xs:simpleType>

Element emo contains any pictorial representation of a facial expression, e.g. ":-)" for a Smiley, or ":-)" for a Frownie. The application might show the first example as .

<xs:simpleType name="Phrase"> <xs:restriction base="xs:string"> <xs:pattern value="$[0-9]+"/> </xs:restriction> </xs:simpleType>

Element phr contains a numeric glyph representing a language independent phrase. So far as this is known only the application Rybka Aquarium is using phrases.

<xs:simpleType name="Message"> <xs:restriction base="xs:string"/> </xs:simpleType>

The content of msg represents a language independent error message token. Example: while parsing a game inside a PGN archive an invalid move will be encountered. The parsing of the game will abort with an appropriate, but language independent error message token, given as a comment after the last valid move. The message token might be followed by arguments, separated with a vertical bar. Currently no further standard for error messages exists. Normally a comment does not have any other content if it contains element msg.



Google translation

Share this page

C/CIF at Sourceforge

C/CIF at Sourceforge

C/CIF at Launchpad

C/CIF at Launchpad