FANDOM


XML Binding Language (XBL, sometimes also called Extensible Bindings Language) is a language for describing bindings that can be attached to elements in other documents. The element that the binding is attached to, called the bound element, acquires the new behavior specified by the binding.

Bindings can contain event handlers that are registered on the bound element, an implementation of new methods and properties that become accessible from the bound element, and anonymous content that is inserted underneath the bound element.

Most XUL widgets are at least partially implemented using XBL. You can build your own reusable widgets from existing XUL, HTML, SVG, and other primitives using XBL.

In XUL one defines the user interface layout of an application, and then by applying "styles" one can customize the look of various different 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 which 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 also 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 may also possess an id attribute. A binding is assigned to an element by setting the Mozilla CSS extension property -moz-binding to the URL of the binding's file. For example:

scrollbar {
   -moz-binding:url('somefile.xml#binding1');
}

wherein binding1 is the id of the binding.


This page uses Creative Commons Licensed content from Wikipedia (view authors).

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.