Re: DOM L2 comments, various

David Brownell <david-b@pacbell.net> writes:

> "Stephen R. Savitzky" wrote:
> >  
> > It's a problem -- there _has_ to be some extension mechanism defined in the
> > spec. 
> 
> The spec allows anyone to define, for example, new interfaces (outside
> of the org.w3c.* space) and implement them, as well as persuade others
> to implement them.

But you might need (or _want_) to define new interfaces that descend from
Node; in that case you would need node types for them.

> I guess I don't see why element and attribute declarations would need
> to look like DOM "Node" objects except for a JavaScript environment.

Because DocumentType is a Node, and the declarations ought to be children of
the DocumentType.  Because some applications may want to be able to handle
arbitrary SGML documents instead of just HTML and XML.  Because Javascript
isn't the only language in the universe without type declarations.  Because
someday the DOM _will_ be extended to handle the DTD, and in the interim
people need a consistent way of experimenting with the expected structure. 

It's not that you can't kludge around the problem in some cases, it's just
that it's much cleaner if you don't have to.

> I've certainly written, and used, enough code where they're done without
> using DOM "Node" objects, so it's not a necessity argument.  I can't
> see much benefit coming from sibling/parent/owner navigation there.

It may not be necessity, but it's certainly a simplicity argument.  There's
a lot of useful stuff in Node that it would be stupid to have to totally
re-implement in order to have an application that could, for example, edit
DTD's as well as documents. 

> I'm more sympathetic to defining new exception codes outside the range
> of the types defined by W3C.

A similar argument applies to node types; one may as well use the same
convention for both.  It's always better to have an explicit extension
mechanism in the spec, so that each application doesn't go off in its own
completely incompatible direction.

-- 
Stephen R. Savitzky  <steve@rsv.ricoh.com>  <http://rsv.ricoh.com/~steve/>
Quote of the month:  Death is nature's way of telling you to slow down.
Chief Software Scientist, Ricoh Silicon Valley, Inc. Calif. Research Center
 voice: 650.496.5710  front desk: 650.496.5700  fax: 650.854.8740 
  home: <steve@theStarport.org> URL: http://theStarport.org/people/steve/

Received on Monday, 4 October 1999 13:56:54 UTC