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

Re: Type-safe iteration over the DOM in DOM 2 & 3?

From: Joseph Kesselman <keshlam@us.ibm.com>
Date: Thu, 22 Mar 2001 14:02:57 -0500
To: www-dom@w3.org
Message-ID: <OF36553FE9.ABBFEE67-ON85256A17.006605B0@pok.ibm.com>

> To my best knowledge, this proposal does simply **not** work

Given our inabilty to rely upon methods being overloaded by argument
signature,  we couldn't define the Visitor API as having both the methods
     execute(Element e)
     execute(Attr t)

We could instead code accept() separately in each node type, so it calls
executeElement() and executeAttr(). But note that this locks in a specific
set of methods on the Visitor; if we added a new node type in the future
(perhaps under DocumentType, as part of the Content Model support),  older
visitors would be unable to support it... though it might be possible to do
something with subclassing Visitor to extend it and saying that the new
nodes will only call back to a suitable ExtendedVisitor.

Joe Kesselman  / IBM Research
Received on Thursday, 22 March 2001 14:03:02 UTC

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