PDA

View Full Version : What is the meaning of the Ui tag of an XML file?


MacDschie
06-29-2005, 02:51 PM
Hi!

I am trying to write my first AddOn and stumbled on the beginning text of the Ui tag which is part of an XML file. Every tutorial I've read says, the XML file has to begin with

<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">


But what does it mean or do? I have found no explanation so far.
The blizzard URLs mentioned don't even exist (on access I get some HTML file containing "The document you requested was not found.").

I hope, there's no possibility to access web sites with this header (or whatever it's called), because this would mean I have to check every addon I install(ed) to avoid access to possibly malicious sites...

Flisher
06-29-2005, 05:21 PM
That a part of the XML standard.

there is no way to reach a webpage from that tag. It's informative and usually, should refer to documentation.

Legorol
06-30-2005, 03:14 AM
The attributes in the Ui tag specify several, technical formalities.

The "xmlns" attribute specifies that by default all attributes and elements in this file belong to the "http://www.blizzard.com/wow/ui/" namespace. This is an optional element of the XML standard. In theory this distinguishes a <Frame> element in this file from a <Frame> element in some different companies XML file. Although it has the form of a URL, the "xmlns" attribute is actually arbitrarily chosen by Blizzard. By convention it is chosen to be a URL belonging to the company to make sure its unique, but it doesn't mean that you find anything at that URL.

The "xmlns:xsi" attribute specifies that any other attributes or elements in this file that begin with "xsi:" belong to the "http://www.w3.org/2001/XMLSchema-instance" namespace. Again, although this looks like a URL, in practice it's just an arbitrarily chosen unique name. This associates a meaning with those attributes or elements (e.g. the third attribute in the Ui tag).

The "xsi:schemaLocation" attribute specifies the "location" of the schema file. Location in this case means namespace + physical file location. The schema file (UI.xsd in this case) constrains what elements are allowed and in what order can they appear in this file. The namespace part of this attribute is not interesting in practice, but the physical file location part is. If you have an editor capable of validating your XML file based on a schema, it will know from this attribute where to look for UI.xsd on your computer (NOT on Blizzard's server).

You can obtain UI.xsd by running Blizzard's Interface Customization Tool, which will extract UI.xsd and place it in your Interface\FrameXML folder. Note that for XML files that are part of AddOns, the correct path to use is actually "..\..\FrameXML\UI.xsd". Unless you specify it like that, your XML editor will not be able to validate the file based on UI.xsd.