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

Re: Update of schema generating transform and grant of license

From: Jeroen van Rotterdam <jeroen@x-hive.com>
Date: Sun, 17 Jun 2001 23:45:37 +0200
Message-ID: <003401c0f776$d8e8f040$1300a8c0@coo>
To: "Arnold, Curt" <Curt.Arnold@hyprotech.com>, <www-dom-ts@w3.org>



> schemas have used <var> for variable declaration and the type
> attribute is required.

ok


> 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.

I understand that but the obj attribute refers to a "var" element that
contains the type information.
You therefore don't need to add the optional interface attribute.

In the example given:
eventTarget = evt.target();   --> you know evt is of type "Event"
targetStr = pi.target();  --> you know pi is of type ProcessingInstruction


> 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 guess you can, the cast can be retrieved from the "var" ELEMENT specified
in the "var" ATTRIBUTE from the method element NOT the "obj" attribute from
the method.

So:

<var      name="eventTarget" type="String"/>
<var      name="evt"              type="Event"/>
<target  obj="evt"                 var="eventTarget"/>

Has every info you need to do:

String eventTarget;
Event evt;
eventTarget = (String)evt.target();

Without the optional interface attribute.



> 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.

Is there an updated xml2java.xsl ?
I'd like to see this.


Regards,

Jeroen
Received on Sunday, 17 June 2001 17:41:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 6 April 2009 12:58:44 GMT