RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


XUL Defines New User Interface Options

XUL is a new Netscape/Mozilla XML dialect that describes the elements of a traditional user interface. Faster and cleaner than HTML, it might just be the quickest way yet to code a UI.


ozilla 1.0 and Netscape 7.0, the re-write and upgrade to Netscape's 4.x Communicator suite, is more than just standards support and new code. During the re-write, the Netscape (now mozilla.org) engineers decided to emphasize XML as the foundation of (nearly) everything in the new browser code. One important result is the XML-based XUL language.

In this article I'll show you how kick XUL's tires a bit and explore how it works. I've used Mozilla here rather than Netscape 7.0, because of the availability of friendly development tools such as the DOM Inspector and the debugger. Otherwise, the two browsers are the same.

What You Need
To run the code that accompanies this article, you'll need Mozilla version 1.0 or later. Netscape 6.x contains Mozilla 0.94, and won't work for this demo. Recent changes to some XUL tags require a full 1.0 release. You can download the official version, or last night's build, at www.mozilla.org. If you're willing to provide feedback, you can do the Mozilla developers a favor and try a talkback version. If you manage to crash the browser, the talkback release generates a diagnostic file that Mozilla developers can use for a post-mortem.

The Who-What-Where of XUL
Most XML standards describe some kind of document, but XUL is the "not a document" XML standard. Before document-centric architectures we had plain ol' user-interfaces (GUIs), coded using Visual Basic, HyperCard or C/C++, to name just a few. When the Web came along, focus shifted strongly toward displaying documents in HTML. In the XML world, XUL is a hybrid solution that provides a way to describe scrollbars, toolbars, tabbed interfaces, and other standard UI controls. However, because XUL files consist of plain-text XML, XUL avoids the problem of 3GL code tortuously exploiting some low-level library like Win32, Swing or GTK.

Even though it's XML-based, you won't find XUL on http://www.w3.org with the other XML-standards. XUL is entirely a Mozilla invention. But you'll find XUL implemented inside all recent AOL/TimeWarner browsers. Mozilla, Netscape 6+, CompuServe 7+ and derived products, are packed with XUL documents. Indeed, the difference between Mozilla and Netscape 7.0 is partly bundling, and partly just different uses of XUL.

Author's Note: XUL might be officially pronounced "zool", after a character in the film Ghostbusters™, but this author can't handle it any more. It's "eks-you-ell" in my head, to match the pronunciation of all the other X-standards, such as XLink and XHTML.

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date