XUL vs. HTML 5
XUL in XULRunner is a way to add native code to an HTML 5 application, by encapsulating in a XUL window.
Otherwise what is the future of XUL? The question is proeminent, especially seeing as Mozilla launches the project of a navigator no longer using XUL, its own language interface, but rather HTML 5.
And it does so because the Gecko rendering engine being able to present web pages in HTML 5, it might be lighter if the XUL language processing is removed.
Remains the question whether HTML 5 can completely replace XUL.
Note that XUL extends DOM with new methods such as getElementsByAttribute.
As for SVG, it can fit into the HTML and XUL code, as explained in section Embedding SVG.
Thus the two languages are based on Web standards. To differentiate we must therefore look to their tags and other features
Three tags are crucial: Canvas, Video and Audio. The first allows virtually doing whatever you want in terms of interface and animation, the other two have a very frequent use that makes them indispensable.
Canvas in XUL and HTML 5 is a tag representing a drawing surface (in Silverlight is a container for other tags graphs).
However the canvas tag of XUL is only a project, while it is already implemented in HTML 5.
Video and Audio
XUL does not have any of these two tags essential for a webpage, but not necessarily useful in an application.
There is a way to add them: embedding HTML code in XUL.
The graphics builtin components are richer in XUL compared to form objects in HTML 5.
For example, XUL provides a tree object, advanced layout tags such as Grid, a template system.
You can build HTML equivalents components but on this plan again, XUL has an advantage because it has the XBL language to facilitate the definition of new widgets.
The advantages of XUL
The use of RDF for widgets allows to define alternative content defined in different files. See an example in the RDF tutorial.
This give access to native code, such as the Native Client from Google for Web applications.
XUL can connect directly to a database with XPCOM and an extension has been specially developed by Mozilla for SQL, see SQL support in Mozilla, but it was written some years ago.
The use of XPCOM is more complex than the use of Ajax coupled with scripts on the server.
An automated installation system for XUL applications. Runs from the Firefox browser.
The structure of any XUL application includes a local directory for the various translations of labels. The mapping is automatic.
Running a XUL application requires the Firefox browser or XULRunner runtime. For its part, HTML 5 will work soon on all browsers and on all systems including mobiles.
There is a light version of Firefox for mobile codenamed Fennec.
The decisive advantage of XUL to HTML is the ability to insert HTML in XUL interface. This gives access to all tags that HTML has plus those it lacks.
XUL seems better suited to build a complex interface with its layout tags, and the language of description of widgets can also build a library of reusable components. When XUL provides additional capacity it is always at the cost of great complexity but it allows the inclusion of native APIs.
- HTML 5.
- XUL Reference. List of all tags.
XUL or XAML or what?