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.


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


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


Received on Sunday, 17 June 2001 17:41:28 UTC

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