W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2000

RE: Older Sibling?

From: <keshlam@us.ibm.com>
Date: Wed, 1 Mar 2000 10:55:57 -0500
To: www-dom@w3.org
Message-ID: <85256895.0057848F.00@D51MTA03.pok.ibm.com>
>There're several other queries like this which could usefully
>be added and which might allow for similar optimizations:
>precedes in document order; is an ancestor of; least common
>ancestor; depth from root etc.

Just a coding tip:

If an optimized operation isn't supported directly in the DOM, consider
writing a library routine to encapsulte it. This could use custom calls
against DOM implementations that provide shortcuts, but fall back on
standard DOM operations for those which don't have such features.

Definitely not as nice as a standard solution, since the wrapper routines
would have to be aware of specific implementations. That makes it a
maintainance pain; you have to enumerate those implementations and maintain
their special-cases individually. And there is a bit of overhead.

But this sort of approach isn't uncommon right now, as folks try to take
advantage of custom features without losing portability (or benefit from
Level 2 features without losing the ability to manipulate Level 1 DOMs)...
and it has the advantage that if a standardized solution does become
available, the wrapper can be trivially switched over to use it without
impacting the rest of your code.

Joe Kesselman  / IBM Research
Received on Wednesday, 1 March 2000 10:56:43 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:06 UTC