XML definitions for DOM2 - improvements

I have used the XML definitions for DOM2 to generate an upgraded Common
LISP binding, as documented at:

   http://interaction.in-progress.com/developer/dom

Here are a few proposed improvements to the XML definitions that will
facilitate better automatic generation of DOM bindings:

* The current descriptions in the XML definitions for DOM2 mixes summary
documentation with examples and verbose explanations. It would be useful if
the descriptions have a richer structure, so that code generators can
extract the appropriate information when building self documented code. I
suggest the addition of new elements to describe the semantics of
descriptions, included a 'summary' element as in this variation of the
description of the tagName attribute:

<descr><summary>The name of the element.</summary>
For example, in: ...
<code>tagName</code> has the value <code>"elementExample"</code>. Note that
this is case-preserving in XML, as are all of the operations of the DOM.
The HTML DOM returns the <code>tagName</code> of an HTML element in the
canonical uppercase form, regardless of the case in the source HTML
document.</descr>

* Several of the interface attributes of node are shared with interfaces
that inherits from node. For example, tagName and nodeName are equivalent
for the element interface. I suggest that the XML definitions of DOM2
explicitely declares this sharing. This would allow code generators to for
example build class definitions that uses one storage slot instead of two
for attributes like tagName and nodeName. Adding a markup attribute called
say 'alias' will cover the need:

  <attribute type="DOMString" name="tagName" readonly="yes"
alias="nodeName">

* The XML definitions of DOM2 should explicitely associate an interface
definition with a nodetype constant, if applicable. This will allow
automatic generation of code that determines the nodetype of an object. I
suggest that the interface element get an optional element attribute
'nodetype' that specifies one of the nodetype constants:

  <interface name="Element" inherits="Node" nodetype="ELEMENT_NODE">




-- Terje <terje@in-progress.com> | Media Design in*Progress

   Software for Mac Web Professionals at <http://www.in-progress.com>
   Take advantage of XML with Emile, the first XML editor for Mac!

Received on Sunday, 9 April 2000 19:18:16 UTC