Business Applications
W O R K S H O P  
Conjure Up XUL for Browser Flexibility

  March 5, 2001
  By Lori MacVittie


In Ghostbusters, Zuul is a minion of Gozer, the badass chick who at the end of the movie tried to destroy New York via the Stay Puft Marshmallow Man. On the Internet, an XML-based language for describing user interfaces, named XUL and pronounced just like "Zuul," is a minion of developers who desire a portable, robust, cross-platform language.



XUL, or XML-based User Interface Language, was created by the Mozilla group to make development of the Mozilla browser easier and faster. XUL helps developers rapidly generate robust user interfaces that can stand alone or be integrated into the Mozilla browser for a customizable deployment to customers or across the enterprise. Both Mozilla and Netscape Communications Corp.'s Netscape 6 use the open-source Netscape Gecko browser engine, which enables both browsers to support XUL. Gecko has been adopted as the browser engine of choice by major vendors, including IBM Corp., Intel Corp., NetObjects and Nokia, because it provides for rapid development of cross-platform applications.

Although Netscape intends to submit it to the World Wide Web Consortium (W3C), XUL is not yet a standard. Microsoft browsers support XHTML (Extensible HTML) to provide an XML-based user interface language though XHTML is not nearly as flexible or robust as XUL (see "XHTML: Crossroads of HTML and XML").



XUL
(screen shot)

Click here to enlarge

XUL Attractions

One of the most compelling reasons to use XUL is its ability to employ user-interface elements to create more flexible and robust interfaces for customers. Some elements supported in XUL that are not readily available in HTML are:

  • Trees: These navigational elements are used frequently but are difficult to implement and support in HTML. XUL provides a tree element as a standard component.

  • Progress meter: This feature usually must be implemented as a small Java applet because of its complexity. In XUL, this component is offered without the applet hassle.

  • Menus and menu buttons: As with trees, these elements are integral to Web-based applications, and built-in support for them makes development less complicated.

  • Scroll bars: Determining the best way to display information is always problematic for developers, and the control over precise sets of information provided by scroll bars makes for a more aesthetically pleasing layout that is also more flexible and easier to develop.
The inclusion of elements used in Web-based applications offers stability and conformity across platforms. There are no more cross-browser scripting and desperate attempts to support diverse implementations of the DOM (Document Object Model).


Because XUL is based on XML, all the benefits of XML are available to developers using the standard; however, the limitations in XML development also come into play. Because invalid elements are not displayed, programmers must take extra care during development. HTML is very forgiving, but XML and XUL are not. XUL's benefits include its rapid development and modification capabilities; its ability to build portable, cross-platform applications; its extensibility and easy localization via CSS (Cascading Style Sheets) for customization; and its ability to allow complete XUL user interfaces to be served via the Web.

Ready, Set, Code

Before getting started with XUL, developers need an understanding of HTML and, because XUL is an XML-based spec that relies on CSS for customization and localization, an even better understanding of XML and CSS.

Although applications can be developed using only XUL elements, the beauty of XUL is its ability to customize the look of an application via skins and provide language support via locales. Without knowledge of CSS, however, developers will be unable to properly develop different "looks" for their applications.

The XUL reference can be found at www.mozilla.org/xpfe/xulref, and it's a good idea to visit the site during development.


   Page: 1 | 2 | 3 | Next Page

Research and Reports

Storage Virtualization Guide
May 2012

Network Computing: May 2012

TechWeb Careers