by Ian Oeschger
|Other articles in this feature:|
What Does XUL Have to Do With XML?
XUL Syntax and Rules
XUL (eXtensible User-Interface Language)is a standards-based interface definition language. It attempts to balance precise control of layout with flexibility and ease of use, and in this respect it does a great job. Using a combination of XUL's ready-made widgets (for example, menubar, scrollbar, progress meter, and so on) and XUL's incorporation of such standards as HTML 4.0, DOM 1 and 2, and Cascading Style Sheets, you can design any interface that you can imagine, using any number of different features, tools, and methodologies.
Topics in this article:
All events and attributes must be written in lowercase.
onLoad) -- must be lowercase or they are invalid.
All strings must be double quoted.
All of the values for all of the attributes declared in XUL are strings. When an attribute is assigned a value (for example,
"onload='doInterestingStartupThing()'") that value must be double-quoted.
Every XUL widget must use close tags to be well-formed
HTML allows some elements, such as
<hr>, to be neither closed nor matched with a closing element. In XUL, elements must either be of the form
<tag />to be valid. For example,
<html:img src="box.gif" />is valid, but
<html:img src="box.gif">is not.
All attributes must have a value.
XUL Is Made Out of XML
You don't need to know all about XML in order to use XUL, but you may want to read through this article to get a sense of XUL's pedigree as a specialized markup language. XUL is based upon XML, so it inherits a lot of the rules and syntax described above from this "meta-language," as you will see. Any familiarity you already have with XML will help you quickly get up to speed developing with XUL.
Pages: 1, 2