I had some mild success last night with implementing a version of this per
the items Klaus and I discussed.  It's really messy and very brittle at this
moment or I would share it.  I'll poke around a bit more this weekend and
see what I can make of it.  I think I figured out why the original author
made some decisions regarding bracketing, etc. How should one interpret the
following?

div#myid > span#1 + span#2 +span#3 > a#myid2

is it:   div >(span span span(a))
or is it: (div>span) + span + (span>a)
or even: div > (span(a) + span(a) + span(a))

Also, it's very crude in that I'm just creating the correct html markup and
passing that to a jQuery object to parse correctly.  I'm assuming that it is
using innerHtml?

One last thing, is it just me, or is the Regex engine in javascript kind of
awkward to work with?  Is there a good way to pull out multiple matches from
a string?  I seem to only be getting the first match.  I'm used to having a
collection of matches to iterate over.

I think I may dig around the jQuery source to get some hints on parsing
elements.  I've yet to even take a peek inside!

Josh



On 7/13/07, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
>
>
> Jonathan Sharp wrote:
> > Turns out he works for the same company I do... I'll see what I can
> do...
> Cool. When tightly integrated into jQuery, maybe with an API similar to
> FlyDom ($(...).createAppend(...)) and the improvements Josh and Klaus
> proposed, this could be really neat. String parsing maybe messy, but
> when jQuery is able to do such a good job selecting elements, why not
> creating them the same way? I may even be possible to leverage parts of
> jQuery's CSS parser.
>
> --
> Jörn Zaefferer
>
> http://bassistance.de
>
>
> >
>

Reply via email to