W3C home > Mailing lists > Public > www-style@w3.org > March 2000

Re: xpath and selectors

From: Daniel Glazman <daniel.glazman@libertysurf.fr>
Date: Mon, 13 Mar 2000 06:10:38 +0100
Message-ID: <38CC784E.4919DA25@libertysurf.fr>
To: joe@joehewitt.com
CC: www-style@w3.org
> It occurred to me today as I was perusing the CSS3 selectors draft that much
> of what one can do with CSS selectors is the same thing that one would do
> with an XPath expression.  Would it not make sense for both CSS and XSL to
> use the same language for selecting nodes?

Oh yes, it would make sense !-) Unfortunately, the xsl people reinvented the
wheel instead of reusing the ***existing*** CSS selectors when they
designed xsl... At that time, CSS was a spec and XSL a draft.

The original list of pseudos of CSS1 and CSS2 was very restricted in
comparison with xsl and that's one of the reason why I proposed to extend
it with all these new pseudo-selectors in CSS 3 selectors module. Most of
the names of these pseudos came from a xsl draft. Harmonization, isn't it ?

> ...
> I realize that XPaths are a little bit more complex than CSS selectors, and
> will often look a bit ugly in comparison (as seen in comparisons above).

Yes.

> But the advantage of course would be the added power and flexibility of
> XPath, and the simplicity of only having to develop one language for
> applying XSL/CSS styles to an XML document.

The disadvantage would be for the existing tons of CSS stylesheets. If XPath
is more ugly and complex than CSS selectors, do you really think that CSS
implementors and CSS authors want it ? I am not kidding : the CSS working
group has always tried to maintain a (very) high level of simplicity and
readability in CSS, and people seem to be happy with that. I am happy
with that. I am not happy with Xpath simplicity and readability.

> For backwards compatibility, perhaps a property can be added to the XHTML
> style element called "selectors" which could take a value of "xpath" or
> "css" to specify which language should be used. Of course it would default
> to "css" for now.
> I'm sure that I'm not the first person to think of this.  Has there been any
> dialogue in the past on the subject of unifying the style node selection
> languages?- Joe

Dialogue ?-) I remember two facing monologues but no dialogue... :-))))

Anyway, harmonization is still a _very_ good idea.

</Daniel>
Received on Monday, 13 March 2000 00:29:48 GMT

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