Appendix B. XML Format
Prev |  | Next

## Appendix B. XML Format

GoGui saves files that are valid XML files according to the document type definition file as retrieved from http://www.rene-grothmann.de/jago/Documentation/go.dtd in 10/2007 (note: the old link does not work anymore, the current location is http://jagoclient.sourceforge.net/Documentation/go.dtd). A copy of this file is included in the GoGui package in config/go.dtd. It should be noted that the XML examples on Jago's web page and the format of the files saved by Jago version 5.0 are not fully conforming to this DTD file. Therfore, GoGui does not strictly validate XML files and understands some of the undocumented deviations used by Jago. However, unknown elements or attributes are not preserved between reading and writing an XML file. GoGui will show a warning, when reading such a file. The following list explains more details about how GoGui handles XML files.

- GoGui uses the MIME-type application/x-go+xml for Go XML files in its desktop configuration files (on GNU/Linux).
- Pass moves are written as move elements with an empty string for the at-property. Handling pass moves was first introduced by GoSVG. Jago has read-support for pass moves since version 5.0.
- The XML documentation says that a paragraph element is optional for comments that contain only a single paragraph, but the DTD file requires them. GoGui will always store comments in a paragraph. When reading a file, GoGui can handle the case of direct text in comments. However mixed text and paragraph elements are not supported.
- SGF comments can have linebreaks and use empty lines to separate paragraphs. GoGui handle paragraphs like Jago does: every comment line (which may be displayed using line-wrapping in the GUI) is stored in a paragraph, empty lines are stored as paragraphs without text content. Despite of the documentation on Jago's web site that paragraphs are handled as in HTML, GoGui does not ignore any whitespaces, it only replaces newlines by empty characters when reading the text content of a paragraph. GoGui stores the paragraph text in a single line. This supports loss-less forward and backward conversion between SGF and XML.
- According to the original DTD, valid children of GoGame are Information and Nodes. Comment is not allowed as the first element in Nodes. However, the first example on Jago's webpage shows a case, where a Comment and move elements are direct children of GoGame. GoGui will always use the Nodes element and will always embed a Comment in a Node, if it is the first element in Nodes. When reading, a Comment can be the first element in Nodes, but Nodes is required.
- The BlackToPlay, WhiteToPlay elements in the DTD have no legal parent and it is not clear why they have a text content. Therefore, GoGui saves the player in a setup position using the legacy SGF PL-property. However when reading a file, it handles the above elements if they are the child of a Node element to set the current player.
- In general, GoGui tries to preserve information using the legacy SGF element, if the DTD has no elements for this information or does not support storing the information in the current node. For example, the DTD supports only one game information per GoGame element, but SGF allows game information in non-root nodes. In this case, SGF elements are used to store the information.
- The Line element in the DTD has no legal parent. It is not used.

Prev |  | Next
gogui-twogtp | Home | Appendix C. Release Notes