XBL
From Wikipedia, the free encyclopedia
- This article is about the markup language. XBL can also stand for Xbox Live.
XBL or XML Binding Language is used to declare the behavior and look of XUL widgets and XML elements. In XUL one defines the user interface layout of an application, and then (applying styles) can customize the look of elements. The drawback is that XUL provides no means to change an element's function. For example, one might want to change how the pieces of a scroll bar work. This is where XBL comes in.
An XBL file contains bindings. Each of them describes the behavior of a XUL widget or XML element. For example, a binding might be attached to a scroll bar. The behavior describes the properties and methods of the scroll bar and describes the XUL elements defining the scroll bar.
The root element of an XBL file is the <bindings>
element, which contains one or more <binding>
elements. Each <binding>
element declares one binding, which can be attached to any XUL element. It also may have an id
attribute. A binding is assigned to an element by setting the CSS property -moz-binding
to the URL of the bindings file. For example:
scrollbar { -moz-binding: url('somefile.xml#binding1'); }
where #binding1
is the id
of the binding.
[edit] History and future
The XBL 1.0 specification is used in the mozilla XPFE platform, alongside with the XUL XML language, so XBL is available on all mozilla products: Firefox, Thunderbird, SeaMonkey, etc. However, it must be noted that Mozilla implements a variant of XBL 1.0 which does not quite match the specification.
An XBL 2.0 version of the specification is on the way. The objectives of this version are to address problems of the 1.0 version, and to generalize XBL usage in non-mozilla browsers. While the body of this version of the specification was created by the Mozilla Foundation, outside W3C (as was the case for the XBL 1.0 version), the W3C Web Application Formats Working Group is now guiding this specification along the W3C Recommendation track. The last call working draft of the specification was released by the W3C in September 2006 [1].
[edit] Relationship with other specifications
The sXBL specification aims to do for SVG documents what XBL has done for XUL documents (SVG is an XML language proposed by W3C supporting graphics, animations, embedded media, events and scripted behavior).
It seems that XBL 2.0 will supersede the sXBL draft [2], as stated in the W3C Web Application Format Working Group site. Also the chapters of the sXBL specification are a subset of those of XBL 2.0.
[edit] External links
- W3C XBL 2.0 last call Working Draft
- draft of Mozilla XBL 2.0 specification
- an XBL primer on mozilla site - A thorough explanation of what XBL is.
- Introduction to XBL - A tutorial on XULPlanet.
- XBL Marquee - An example implementation.