Re: NodeList (Re: CSS::SAC)

At 09:42 21/03/2001 -0500, Joseph Kesselman wrote:
>If the NodeList returned by a DOM call isn't live, you can't claim to
>comply to the DOM specification.

I'm building a Perl DOM based on Ken's work. Compliance is one thing that
I'm gunning for (to a certain degree at first, more later) but so is
performance. Live NodeLists just don't work with the latter. Note that
using a simple array reference means that the NodeList is already close to
being live, if the array is modified somewhere then it'll be modified
everywhere simply because it's a reference. However, the Nodes it contains
won't see their {Previous,Next}Sibling updated, and other such nastiness.

>If you really want a non-live "snapshot" array, I would recommend that you
>create a new class and a new method to retrieve it -- as long as you're
>going to be incompatable anyway, you might as well make the difference
>visible and official.

The way this is made visible and official is first and foremost claiming to
stick first to the Perlish DOM, and then only to DOM2 (a la JDOM). Also,
the Document interface is extended to have a setNodeListFactory() method,
which allows one to choose the kind of NodeList one wants. I think that
such options nicely resolve the comply to rec vs get the job done tensions.

Beyond that, cross-language interop (as Ken pointed out) can be achieved
using wrappers, adapters, specific options to the DOMImplementation, and in
some cases nothing at all.

-- robin b.
All programmers are playwrights and all computers are lousy actors.

Received on Wednesday, 21 March 2001 10:01:16 UTC