This is what I came up with for the XPath version: http://pastie.caboo.se/47671

It's a direct port of the logic of parseNth (albeit not yet tested).
I'll look at yours and see if it makes more sense, though.

Cheers,
Andrew

On Mar 17, 4:51 pm, Trevan Richins <[EMAIL PROTECTED]> wrote:
> Andrew Dupont wrote:
> >> This site might be useful:http://gallery.theopalgroup.com/selectoracle/
>
> > I'd found that site as well, but it seems to get stuff wrong. If I ask
> > it to explain "ul>li:nth-child(n+2)," it replies with:
>
> Wow, I didn't notice that one.
>
> The parseNth code looks better.  I'm wondering, though, how you are
> going to convert it to Xpath?  This is what I came up 
> with:http://pastie.caboo.se/47653.  It is similar to the patch I submitted in
> the original bug but is slightly more condensed.
>
> It first reduces the selection to the elements that fit the "bth item
> from groups of a".  Then, in the resulting selection, it grabs the
> elements that have a position (in this new selection, not the original
> one) that are >= b/a (for a > 0) or <= b/a (for a < 0).
>
> Trevan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to