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

Re: XPath & CSS, again

From: Pascal Schmitt <pascal@cebra.nu>
Date: Tue, 12 Apr 2005 09:03:13 +0000
Message-Id: <5e69f46940e71d2a48da81f5a0722d09@cebra.nu>
To: Bert Bos <bert@w3.org>
Cc: www-style@w3.org


>> My intention was not to /replace/ CSS with XPath but to enhance it.
>> Especially for generated-content, this would be helpful as there is
>> afaik no special CSS-Syntax yet (and you could use XPath 1:1 for
>> generated-content, couldn't you?)
> You'll have to explain that...
> The CSS selectors for generated content are :after and :before (and
> ::marker in CSS3 for the list marker).

Oh, I meant using XPath-Expressions for the "content" property, like 

table::after {
   content: xpath("count(tbody/tr)") " lines";

Speaking of tables: there should be a CSS-Selector which enables me to 
select cells by column without knowing its position:

Consider this table:

<col id="a" /><col id="b" /><col id="c" />

To give all cells in the "b"-column a blue background-color, one could 
use CSS like that:
   table > tbody > td+td { background-color: blue; }

But you have to know, which column (here: the 2.) it is.
   table > tbody > td[ col(b) ] { background-color: blue; }
Would seperate the stylesheet from the content as you don't have to 
know the column order.

Pascal Schmitt
Received on Wednesday, 13 April 2005 16:20:43 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:17 UTC