XML Events and DOM manipulations

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 UTC