One of the most promising technologies to emerge from the efforts around XML -- at least from the point of view of web and application developers -- is XUL. XUL, the extensible user-interface language, is a standards-based way to create the user interface for a cross-platform application. It allows you to do with a few lines of markup language what until now took many lines of code. Applications interfaces, with their windows, frames, scroll bars, menus, and toolbars, are created easily -- and just as easily customized by the user.
Eric Krock, senior product manager at Netscape, gave a brief but enticing presentation at XTech on XUL. XUL was co-developed by Netscape and the Mozilla project during the last few years of work on the browser. Krock's enthusiasm for XUL rested largely on two capabilities:
XUL emerged from Mozilla/Netscape's efforts to efficiently build cross-platform interfaces. "Building separate front-ends for Windows, Macintosh, and GTK is expensive," Krock said.
Instead, XUL lets you create a browser interface in just a few lines of markup code. He showed the room the code for a menu bar that ran about 12 lines.
"It's going to democratize application development," Krock said.
Here's a sample of window code, take from Krock's presentation, which he has posted online.
<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/xul.css" type="text/css"?> <!DOCTYPE window> <window id="main-window" xmlns:html=http://www.w3.org/TR/REC-html40 xmlns="http://www.mozilla.org/keymaster/gatek eeper/there.is.only.xul"> <menubar><menu name="File"> <menuitem name="Hello World!" onclick="dump('Hello world!\n');"/></menu> </menubar> <html:iframe id="content-frame" src="contentframe.html" flex="100%"/> </window>
For More Information:
Krock's A Taste of XUL presentation
Mozilla.org's Introduction to XUL
XUL is not a standard, but Krock said Netscape intends to submit it to W3C. When the first beta of the Mozilla 5.0 browser is released -- and this is expected to be within a few weeks -- users should begin to have some fun customizing their browser interface with more control than ever before.
Included in the list of future improvements is server-cached XUL, which automatically updates a UI on launch, or on request. I believe we're also destined to see extensions to XUL that make it a more complete application programming environment, with more ways to tie into the functionality of other apps.
Also at XTech 2000: Behlendorf Urges XML Developers to Support Apache Tools
Copyright © 2009 O'Reilly Media, Inc.