4. XML Reference

OpenTEA interprets XML files to define the interfaces. For a complete description of the XML standard, see the w3schools website.

4.1. OpenTEA element examples

OpenTEA interprets a specific subset of the XML standard. The vocabulaty involved can be misleading (notable the word value can refer to many thigs). To help clarify this, two examples are given and described below.

OpenTEA expects XML “elements”, also referred to as a “nodes” because of the tree-like structure of an xml document, to look like one of these:

<info name="interesting_info"/>
    This is a description

The following definitions apply to this exmaple:

  • info and desc are called the tags of the elements
  • the info element has an attribute called name, and its value is “interesting_info”
  • the desc element has no attributes, but it has itself a value: the This is a description string

One final fact often confuses further users: attributes can have any name, and in OpenTEA one is used very often: value. Putting this together:

<info name="interesting_info" value="Infos;More infos"/>

Here, the tag is info, the attribute name has the value “interesting_info”, and the attribute value has the value “Infos;More infos”. Notice that the value attribute has a very free format. Here, it contains spaces, and a ; that can be later parsed to store lists. The name attribute however must follow specific rules, explained below.

4.2. Rules for the name attribute

OpenTEA adds some rules to the above definitions. The name attribute has several restrictions:

  • letters must be lowercase
  • it cannot contain spaces
  • it cannot start with a digit