W3C home > Mailing lists > Public > www-style@w3.org > December 2002

Re: XBL is (mostly) W3C redundant, and CSS is wrong W3C layer for semantic behavior *markup*

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 30 Dec 2002 17:50:58 +0000 (GMT)
To: Shelby Moore <shelby@coolpage.com>
Cc: "L. David Baron" <dbaron@fas.harvard.edu>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <Pine.LNX.4.21.0212301637000.9121-100000@dhalsim.dreamhost.com>

On Mon, 30 Dec 2002, Shelby Moore wrote:
> 
> From private discussion, I generated the following XSLT snippet which is
> concise example of XSLT's powerful capabilities to make general transforms
> from abstract markup to any desired implementation.  This translates a
> <select> into radio buttons.

No offense but that _completely_ misses the point.

Here you have a document fragment:

   <foo size="1">
    <bar> baz </bar>
    <bar> quux </bar>
   </foo>

Make it so that when that document fragment appears in a graphical Web
browser, it renders as a horizontal box with the width "quux", the height
of one line, so that when you click on it you get a drop down box with
the two items on it, so that when you hover over an item you get a hover
effect, so that when you click on an item the value of the box changes and
so that form submission and session history take this value into account.



> Remember that XSLT is Turning complete [...]

So is the brainfuck programming language [1], but that doesn't tell you
ANYTHING about how useful the language is.

Turing complete does _not_ mean it can do anything -- XSLT cannot, for
instance, add a new DOM interface to an element.

And nor should it, because XSLT and XBL solve different problems.


Here are a couple of other problems that XBL can do but which XSLT cannot,
or cannot do as neatly:

   1. The header on http://www.hixie.ch/, in Mozilla, drops down a menu
      when you click on it, without affecting the document's DOM.

      Can you do this in XSLT in a ways that is as understandable and
      simple? Can you do it without requiring me to change every page on
      my entire domain? (The binding [2] is linked in using a single rule
      in a site stylesheet. This is appropriate, because the menu is
      purely stylistic and adds nothing of value to the document.)

   2. The times next to the posts on http://ln.hixie.ch/ are, in the
      markup, served as times in UTC. Using XBL [3], the times are
      displayed in the local time zone.

      Can you do this is XSLT at all?


> Also remember that we are comparing XSLT and XBL, not XUL. 

XSLT, XBL and XUL are three, IMHO, totally orthogonal languages.

XUL is simple a markup language like CSS; it doesn't require any other
language, but typically CSS and XBL are used to specify the rendering.

XBL is an extension to the DOM and to CSS. These are two separate roles.
In its role as an extension to the DOM, it allows individual elements to
be extended to support new interfaces. In its role as an extension to CSS,
it allows individual elements in the markup to have their children
reordered and wrapped, so that CSS has more elements to play with, and
allows elements to have script associated with them to give dynamic
behaviours to them. Behaviours are not semantic -- a radio button need not
change colour when it is being clicked, and it need not be a single round
button, it could be toggle switch. XBL allows you to map the semantics
(radio button) to a style and behaviour (animated push switch that
requires you to double click it).

XSLT is a document tranformation language, designed to take an entire
document and replace it with another. It is not dynamic, and addresses a
totally different problem space.


-- References --
[1] http://www.muppetlabs.com/~breadbox/bf/
[2] http://www.hixie.ch/resources/bindings/sites.xml
[3] http://ln.hixie.ch/resources/bindings/timezone.xml

-- 
Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 30 December 2002 12:51:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:18 GMT