Glest uses several types of XML, or eXtensible Markup Language, files to define gameplay parameters and store information needed for Glest. These XMLs can hold everything from a unit's HP to the camera positions in the main menu, to particle information.
- Unit particle system
- Projectile particle system
- Splash particle system
XML Key terminology
The material in this section is based on the XML Specification. This is not an exhaustive list of all the constructs which appear in XML; it provides an introduction to the key constructs most often encountered in day-to-day use.
- (Unicode) Character
- By definition, an XML document is a string of characters. Almost every legal Unicode character may appear in an XML document. The exceptions are characters used in the markup, <, >, and ", which can be replaced with <, >, " respectively.
- Processor and Application
- The processor analyzes the markup and passes structured information to an application. The specification places requirements on what an XML processor must do and not do, but the application is outside its scope. The processor (as the specification calls it) is often referred to colloquially as an XML parser.
- Markup and Content
- The characters which make up an XML document are divided into markup and content. Markup and content may be distinguished by the application of simple syntactic rules. All strings which constitute markup either begin with the character "<" and end with a ">". Strings of characters which are not markup are content.
- A markup construct that begins with "<" and ends with ">". Tags come in three flavors: start-tags, for example
<section>, end-tags, for example
</section>, and empty-element tags, for example
- A logical component of a document which either begins with a start-tag and ends with a matching end-tag, or consists only of an empty-element tag. The characters between the start- and end-tags, if any, are the element's content, and may contain markup, including other elements, which are called child elements. An example of an element is
<Greeting>Hello, world.</Greeting>. Another is
- A markup construct consisting of a name/value pair that exists within a start-tag or empty-element tag. In the example (below) the element img has two attributes, src and alt:
<img src="madonna.jpg" alt='Foligno Madonna, by Raphael' />. Another example would be
<step number="3">Connect A to B.</step>where the name of the attribute is "number" and the value is "3".
- XML Declaration
- XML documents may begin by declaring some information about themselves, as in the following example.
<?xml version="1.0" encoding="UTF-8" ?>
The two forks of Glest, GAE and MegaGlest both support radically different code. Both are shown on these XML definitions, but all are optional. Even if you are making your mod for one of those engines, they can be safely skipped. Many children of these engine unique tags may also be optional, in which case, it will say in the documentation. Optional elements should be excluded completely from the XML.
|This page uses content from Wikipedia. The original article was at XML. The list of authors can be seen in the page history. As with the Glest Wiki, the text of Wikipedia is available under the Creative Commons Attribution-Share Alike License 3.0.|