|
XML Standards Update; Introducing XML EventsThe HTML Working Group of W3C released a Last Call Working Draft of XML Events on October 26, 2001. XML Events defines a module used to associate behaviors with document-level markup for XML languages, and supports the DOM Level 2 event model. The following definitions are useful in understanding XML Events:
In the DOM Level 2 model of events, the general behavior is that when an event occurs it is dispatched by passing it down the document tree from the root in a phase called capture to the element where the event occurred (called its target), where it then may be passed back up the tree again in the phase called bubbling. In general, an event can be responded to at any element in the path (an observer) in either phase by causing an action, and/or by stopping the event, and/or by cancelling the default action for the event at the place it is responded to. HTML currently binds events to an element by encoding the event name in an attribute name, such that the value of the attribute is the action for that event at that element. An example is "onmouseover." This method hardwires the events into the language. This is a disadvantage because in order to add a new event, a change to the language must be made. This binding also forces you to mix the content of the document with the specifications of the scripting and event handling, rather than allowing for a separation. XML Events provides an extensible event specification method that provides for new event types without requiring modification to the DOM or the DTD and allows for integration with other XML languages. |