W3C home > Mailing lists > Public > www-dom-ts@w3.org > June 2001

RE: Update of schema generating transform and grant of license

From: Arnold, Curt <Curt.Arnold@hyprotech.com>
Date: Sun, 17 Jun 2001 14:25:15 -0600
Message-ID: <B2C1451A181BD411B88A00E018C1C19C08AD0E@thor.aeathtl.com>
To: "'www-dom-ts@w3.org'" <www-dom-ts@w3.org>
Jeroen van Rotterdam wrote:
>A declare element has an optional interface attribute, I guess this
>should be mandatory

In an earlier version, I had used the <declare> element to indicate
a variable declaration.  However, later I realized that this conflicted
with the element generated for the declare attribute of the
HTMLObjectElement interface.  Subsequent
schemas have used <var> for variable declaration and the type
attribute is required.
>dom methods:
>Every dom method has an optional interface attribute. Variables are
>already declared and have therefore already a type. The interface
>attribute is redundant here. A stylesheet can easily pick up the type
>from the declare element.

The interface attribute is unnecessary (and optional) for 
the vast majority of methods and properties.  
The only time it is required is when the
same method or property is independently introduced in multiple
interfaces, for example, Event.target and ProcessingInstruction.target or
ProcessingInstruction.data and CharacterData.data.

In these cases, the interface attribute allows you to disambiguate
between the two forms, which in this case have substantially
different signatures.

<target interface="Event" obj="evt" var="eventTarget"/>

<target interface="ProcessingInstruction" obj="pi" var="targetStr"/>

You can't depend on the type of obj since casts are automatically
generated by the transform and if the obj type is Node and the
property was data, you couldn't determine if ProcessingInstruction.data
or CharacterData.data was intended.

I produced an optional interface attribute for instances 
where you are writing a test for a particular DOM level but
you anticipate that there might be a name conflict in a later
DOM level.  That is you could do:

<nodeName interface="Node" obj="node" var="nodeName"/>

However, if allowing that future-proofing is confusing
it can easily be removed from the schema generator.

>method parameters.
>Methods parameters are currently passed through named attributes of a
>"method" element.
>I might be incorrect but it seems to that you than need to specify every
>method in the xml2java stylesheet.
>If this can be automated than it's fine with me, If we on the otherhand
>need to code every method by hand in this stylesheet than I suggest
>something like:
>  <rowIndex obj="...." var="....">
>      <param value="..."/>
>  </rowIndex>
>In such a setup we can create the stylesheet easily for every method.

It is only necessary to introduce explicit templates for the 
language constructs like <if>, <for-while>, etc.  DOM methods
and properties are generated by generic templates that compare
the element in the test with the interface definitions in
the DOM spec and properly generate the appropriate code.
Received on Sunday, 17 June 2001 16:25:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:34:03 UTC