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

Re: [CSS3] selectors to use xpath syntax

From: Orion Adrian <orion.adrian@gmail.com>
Date: Thu, 8 Dec 2005 09:26:32 -0500
Message-ID: <abd6c8010512080626v68ebb9e2ob46f7a3f761d1637@mail.gmail.com>
To: www-style@w3.org

On 12/8/05, Christoph Wieser <wieser@cip.ifi.lmu.de> wrote:
>
> Hi Manuel,
>
> in most of the cases the translation of CSS-Selectors to XPath
> expressions is rather easy but translating pseudo-classes like :hover or
> :link to XPath turns out to be a problem.
>
> Kind regards,
> Christoph
>
>
>
> Manuel Strehl wrote:
> > Hi.
> >
> > How about introducing a pseudo-class (for example), that allows
> > selection by using xpath syntax. Most of the common browsers already
> > include a XSLT parser with (more or less) full XPath support, so
> > technically there should be no problem.
> >
> > CSS syntax could be something like:
> >
> > body:xpath( ./div/table ) {} /* == body div table {}  */
> >
> > based upon the element carrying the pseudo-class. An expression like
> > *:xpath( /... ) could refer to the document root and allow complete
> > switching to xpath.
> >
> > I DO see that with this proposal I run into conflict with my last
> > posting about "//" comments, but that's life... ;-)

XPath allows for functions which is what would map to the various
pseudoclasses, though you would have problems with some of them.
Again, though, he didn't ask for the removal of normal CSS selectors
so you could have both in the same document, using CSS-native
selectors where deemed appropriate.

--

Orion Adrian
Received on Thursday, 8 December 2005 14:26:53 GMT

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