Jeremy Bowers:
> I added the xmlns declaration to your first svg tag, because I think you
> need it and I need it for my point.
>
> This won't work. The 'abbreviation' of the namespace ("ex" and "ge"
> here) aren't supposed to have any real meaning. In:
>
> <somenode xmlns:a="http://a.uri.com/x" xmlns:b="http://a.uri.com/x">
> <a:x />
> <b:x />
> </somenode>
>
> there's no difference between the two "x" tags (other than order, of
> course); the tags aren't in "two namespaces", they both go to the same
> namespace.
>
> Distinguishing between the two prefixes would be a misfeature. An XML
> parser really shouldn't give you enough information to tell the two
> apart; if it does, you *certainly* shouldn't use it.
Yeah, it seems a bit dodgy somehow to rely on the prefix that was used
(especially since the element may have been created in a namespace but
without a prefix using createElementNS). (A namespace mapping, as can
be done in XSLT, would be possible, but this doesn't seem much nicer.)
Putting the shadow tree inside the element is cleaner than having it
beside the element, though.
> XBLinJS actually does require that every widget have one and only one
> top-level node, which works in HTML because we can almost always use
> span and div. I don't know if SVG has a similarly "neutral" collection
> tag. (It should, though; anything implementing DOM events should have
> such a node so you can put the event handlers in the right place, once.)
> Everything under that widget node is assumed to belong to that widget,
> although there may of course be other widgets below that.
Yes, SVG has the 'g' element, which is a group. Some bindings care
about the children of bound elements, so this problem of shadow trees
being visible in the real DOM still exists. The bindings would have to
know to ignore the shadow tree container.
Anyway, I think the summary is that it's impossible to have a complete
implementation of any of the XBLs in script, but you can do a reasonable
job if you are careful.
--
Cameron McCormack ICQ: 26955922
cam (at) mcc.id.au MSN: cam (at) mcc.id.au
http://mcc.id.au/ JBR: heycam (at) jabber.org