OAP Lizzard A game interface engine
Game interfaces, outside the game Settings
← XML guide

Documentation / XML guide

Files and loading

The .toc, the elements a file may hold at the top, and how other files are found.

An addon's .toc file lists its Lua and XML files. They load in that order, each one finished before the next starts. Inside an XML file, Lizzard takes the top-level elements in the order they are written, and an <Include> or <Script> loads its file there and then.

MyAddon.toc

## Interface: 16001
## Title: My Addon
Core.lua
Frames.xml
Main.lua

Frames.xml

<Ui xmlns="http://www.blizzard.com/wow/ui/">
  <Include file="Templates.xml"/>
  <Script file="Frames.lua"/>
  <Frame name="MyWindow" parent="UIParent" inherits="MyWindowTemplate"/>
</Ui>
The order an addon's files load in The .toc lists Core.lua, Frames.xml and Main.lua. Core.lua runs first. Frames.xml then includes Templates.xml, runs Frames.lua, and builds MyWindow. Main.lua runs last. MyAddon.toc Core.lua Frames.xml Main.lua Frames.xml, top to bottom <Include file="Templates.xml"/> <Script file="Frames.lua"/> <Frame name="MyWindow" .../> 1 2 3 4 5 Templates.xml loads completely at step 2, so MyWindowTemplate exists when MyWindow is built.
Everything happens in the order written. An include is loaded completely before the next line of the file that includes it, so a template must be loaded before a frame that inherits it.

What a file may hold at the top

ElementWhat Lizzard does
<Script file="x.lua"/>, or a <Script> with Lua inside Runs the file, or the Lua written inside.
<Include file="x.xml"/>Loads that XML file, there and then.
<Font>, <FontFamily> Makes a font object, a global by its name, even when it says virtual="true". A font family uses the member for the client's alphabet: roman on an English client.
Anything with virtual="true"Keeps it as a template, to be used by inherits (Templates).
Anything with intrinsic="true"Makes a new element name that works like a frame type (intrinsic types).
A frame: <Frame>, <Button>, <EditBox> and the rest Builds it now.
<ScopedModifier>Loads what is inside it as if it were at the top. Its own attributes concern Blizzard's protected code and are not read.
Anything elseLeaves it out and says so once: "top-level <X> is not loaded yet".

Finding the files

Paths in file="" use backslashes, as Blizzard's files do: file="Widgets\Button.xml". Lizzard looks beside the XML file first, then from the addon's own folder. Blizzard's code needs the second: one of Retail's item button files names its Lua from the addon's folder. Guessed which one the game tries first.

A Lua file run by <Script file> gets the addon's name and its shared table as ..., as a Lua file listed in the .toc does. Guessed

Spelling counts

  • Element and attribute names are matched exactly, in the case UI.xsd gives. A <script> in lower case is not a <Script>: Lizzard turns it away.
  • The namespace on <Ui> doesn't change anything; only the element names count.
  • Yes or no attributes take true or false; 1 and 0 work too, as UI.xsd allows.