-
Notifications
You must be signed in to change notification settings - Fork 29
XML Guide
Kassiopeia uses configuration files written in eXtensible Markup Language (XML) format.
General XML tutorials are covered elsewhere. This page will cover the extensions to generic XML that are specific to Kassiopeia.
Each XML tag, also referred to as an element, creates an object of a particular type. An element's attributes are used to set the properties of the object, and often elements can be nested according to the relationship between the corresponding objects:
<car name="vroom" make="mazda">
<engine cylinders="6"/>
</car>
In the above example, we create a car, which we lovingly name "vroom," which is a Mazda. We give it an engine with 6 cylinders.
Kassiopeia configuration files are processed sequentially; later elements in a configuration file can refer to elements defined previously. In the following, we create a parking space and assign the car "vroom" to it:
<parking space="582" car="vroom"/>
Entire configuration files can be included within other configuration files. When an include
tag is reached during the processing of a configuration file, the XML parsing will switch to the included file. The attributes for the include
tag are path
to specify the location of the included file, and base
to specify the filename:
<include path="/path/to/files/" base="BasicDefinitions.xml"/>
Note that the included file will be parsed as if it were part of the original file at the location of the include
tag. If the include
tag is located inside of an element, everything in the included file will be treated as if they're inside of that element.