> The CSS 3 :root selector is not supported unfortunately, but the root
> node of a document is represented by document.documentElement.
>
> So you could try:
>
> $('> KNOWN_NODE', document.documentElement)
>
> or
>
> $(document.documentElement.tagName + ' > KNOWN_NODE')
>
> Does that work?

Yes it does, thanks!  This clears up a lot of confusion on my part even
though it isn't the answer I was looking for.  This will only work when
KNOWN_NODE is only one level deep, and as far as I know there is still no
way to go n levels deep with CSS expressions.

However, I now realise I can do this with the children() method:

$(document.documentElement).children().find('> KNOWN_NODE')

Lemme see if I can hack that into the Basic XPath plugin...

Thanks,

Tim

Reply via email to