XUL
XUL (XML User Interface Language) is a proprietary standard developed to support Mozilla applications like Mozilla Firefox and Mozilla Thunderbird. Like UIML, it is an application of XML that describes user interfaces. The initialism can be pronounced as zool (to rhyme with "cool").
While XUL is not a public standard, it reuses many existing standards and technologies, including CSS, JavaScript, DTD and RDF, which makes it relatively easy to learn for people with background of web programming and design.
The main benefit of XUL is that it provides a simple and portable definition of common widgets. This reduces the software development effort in a way analogous to the savings offered by 4GL tools.
Einführung
An XUL interface is typically defined as three discrete sets of components:
- Content
- The XUL documents, which define the layout of the user interface.
- Skin
- The CSS and image files, which define the appearance of an application.
- Locale
- The DTD documents, which define entities for easy software localization.
For an example, see a "Hello World!" program written in XUL.
XUL elements
The XUL specification covers a wide range of elements, which roughly belong to the following types:
- Top-level elements
- e.g. window, page, dialog, wizard, etc.
- Widgets
- e.g. label, button, text box, listbox, radio button, check box, tree, menu, toolbar, group box, tab box, color picker, spacer, splitter, etc.
- Box model
- e.g. box, grid, stack, deck, etc.
- Events and Scripts
- e.g. script, command, key, broadcaster, observer, etc.
- Data source
- e.g. template, rule, etc.
- Others
- e.g. overlay (analagous to SSI, but client side), iframe, browser, editor, etc.
It is possible to use elements from other applications of XML within XUL documents, such as XHTML and MathML.
Some common widgets - such as spinbox, slider, and canvas - are not available in the current XUL specification, but are on the XUL 2.0 to-do list [1].
Usage
While XUL is mostly used for creating the Mozilla application itself and its extensions, it is possible to use it for web applications transferred over HTTP. One of the most well-known XUL applications of this type is the Mozilla Amazon Browser, which provides a rich interface for searching books at Amazon.com. However, many of the powerful features of Mozilla, like privileged XPCOM objects, are not available to remote XUL documents, and such documents also suffer from various limitation of the browser, such as the inability to load remote XUL, DTD and RDF documents.
Film references
The XUL name is a reference to the film Ghostbusters, in which a ghost called Zuul possesses a character named Dana (played by Sigourney Weaver) and declares "There is no Dana, only Zuul". Since XUL is unusual in using XML to define an interface, rather than a document, its developers adopted the slogan "There is no data, only XUL", as can be seen from the document pointed by the XML namespace URI (http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul). When viewed with an XUL-capable application, it renders something like this:
"Keymaster" and "gatekeeper" are also references to the same plotline. This is not the only reference to Ghostbusters within Mozilla - for instance, the JavaScript debugger component is called Venkman, one of the main characters in the film.
See also
External links
- Mozilla XUL page
- XULPlanet - A developer site with tutorials, references and forums.
- Xul-fr - A French site about XUL.
- Xul Runner - An attempt to run XUL applications in a light-weight container.
- Book Support Site