Re: DOM L2 comments, various

Arnaud Le Hors <lehors@w3.org> writes:

> David Brownell wrote:

> >         * I can't see how I'd write a chunk of code that'll know it
> >           can use Level 2 features ... e.g. it's portable and needs
> >           to work with both L1 and L2.
> 
> I don't understand, the idea is that you'd write something like:
> 
> if (DOMImplementation.hasFeature("XML", "2.0")) {
>   printOutElementWithNS(el);
> } else {
>   printOutElement(el);
> }

This works in an interpreted language, or a compiled language that supports
interfaces, as Java does.  In a compiled language which does not support
interfaces, for example C++, printOutElementsWithNS will fail to compile, or
may compile against header files but fail to link against the DOM
implementation actually in use.

> > 1.2     DOMException ... ambiguous re whether the other numeric
> >         codes are reserved to W3C or not.  They should be.
> > 
> >         Similar comment for "Node" ... nobody except W3C should
> >         be defining new numeric codes for "nodeType".
> 
> I added wording to make this clear.

This would be disastrous for those implementors who need to define new
types.  For example, the DOM currently does not have nodes that an
implementation can use to represent the DTD.  Those of us who need to
represent DTD's _must_ define new node types.  

My solution is to use node types and exception codes less than zero; this is
a direction in which the DOM is unlikely to go, and it seems better to
reserve negative codes for implemention-specific uses than to completely
prevent extensions.  The only possible effect of the latter would be to
force those of us who find the present specification too limited to
abandon the DOM altogether.

-- 
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 12:23:29 UTC