As with most toolkits, XULÕs capabilities can be extended to suit your application. The predominant method of doing this is by using XBL, the Extensible Binding Language.

XBL allows you to express new XUL tags using existing ones, and provide methods and properties for them inline in the XBL XML file using JavaScript, or elsewhere by attaching the binding to an external implementation of an XPCOM interface.

XBL bindings can follow some of the conventions of the JavaScript language – they support inheritance, for example.

Most of the elements in the XUL language are in fact implemented using the basic primitives of XUL – the box layout, text and image nodes. A XUL button for example is an image node for the icon and a text node for the image arranged either horizontally or vertically.

XBL implementations of new tags are attached to a XUL document using a style sheet. A selector matches on id, class, tag name (e.g a new tag name) or some other condition and attaches the referenced binding which creates the element behavior that script supplied by the XUL document can interact with.

Brian Ryner will be giving a presentation tomorrow with more information about extending Mozilla with XBL.