W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2002

XML Events and DOM manipulations

From: Philippe Le Hegaret <plh@w3.org>
Date: 16 Apr 2002 16:49:50 -0400
To: www-html-editor@w3.org
Cc: www-dom@w3.org
Message-Id: <1018990191.16674.65.camel@jfouffa>

The DOm Level 2 Events module allows applications to attach event
listeners on a DOM Node. The XML Events defines a syntax for authors to
attach those event listeners in the XML document itself.
However, it is not clear when those listeners are attached to the DOM
tree if any: is it at load time? when the document is fully loaded?
If you start doing manipulation on a DOM tree, such as modifying the
observer XML attribute, who is responsible to remove and reattach the
the listeners?
Furthermore, the DOM Events module mentions [1]:
[[
When a Node is copied using the cloneNode method the EventListeners
attached to the source Node are not attached to the copied Node. If the
user wishes the same EventListeners to be added to the newly created
copy the user must add them manually.
]]

In other words, cloning an XMl Events node will not reattach the
listeners automatically at the DOM level.

It is the opinion of the DOM Working Group that XML applications should
define their relations with the DOM Events model in order to use it. The
XMl Events specification should define who is responsible to attach the
listeners on the DOM tree: "XML Events implementation must attach or
remove event handlers appropriately after any XML Information Set
change."

Philippe

[1]
http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-EventListener
Received on Tuesday, 16 April 2002 16:49:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:56 GMT