Re: First-descendant-of-type selector?

* dolphinling wrote:
>In this case,
>ul#a :not(ul#a)>li
>selects the <li> inside <bar>, even though it's not an item of list a. (This is 
>the same problem with Bjoern's nearly-identical solution above.)

Then you are looking for all li elements whose closest ancestor ul
element is equal to the element with ID 'a'. That's trivial in XPath,

  //li[ ancestor::ul[1] = id('a') ]

You cannot create a equivalent CSS Selector without the notion of
"closest ancestor" or "immediate descendants" if you begin the ex-
pression with the ul element. What you can do, of course, is

  ul#a li    { ... }
  ul#a ul li { ... }
  ...

which would cover most, if not all, use cases, as far as style
sheet authoring is concerned.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Saturday, 2 September 2006 17:08:57 UTC