Home Best Practices
  Sponsored by Magnetar Games

Best Practices

GameXML consists of a tightly intertwined group of XML documents. To maintain consistency we are defining a series of "best practices" to be used when creating the schemas for these documents.

Status of this document

This document is a work in progress and is subject to change. This is version 1.0 of this document.

1.0 Elements

1.1 Case

All elements will use Upper Camel Case (UCC). The first letter of each word of an element is capitalized. There are no underscores or dashes used in element names. When an acronym is part of the element name, it will be used in uppercase. If another word follows the acronym, its first letter will be lowercase, except in the circumstance where the second word is also an acronym, in which case all letters remain uppercase.



1.2 Use

Elements will be used for complex types (containing other elements or large amounts of text) only. Data which can be defined with simple datatypes should be coded as attributes. If the instance data is not expected to exceed a line and will not contain other elements, the data should be encoded in an attribute.

2.0 Attributes

2.1 Case

Attribute names will use the same conventions for case as elements.

2.2 ID

The attribute name "ID" is reserved for specifying a unique identifier for the element in which it is used. When an ID is specified, this entity may be referenced by that ID elsewhere in the XML document or in XML documents which include the current one.

2.3 Ref

The attribute name "Ref" is reserved for specifying a reference to an ID declared elsewhere. When an element needs to indicate a pointer relationship with another element, it uses the "Ref" attribute to do so.