spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / xml / column43

Living documents with XML events

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Most documents today are living documents in the sense that they are constantly updated and never finished. With the advent of HTML and Web browsers documents became also living in that they can interactively respond to events. Now this kind of life comes to XML documents with the newly standardized XML event handling...

An event is the manifestation of some asynchronous happening associated with an element in an XML document, such as a mouse click on some text element, or an arithmetical error in the value of an attribute, or one of many other possibilities.

In the DOM event model, an event is dispatched by passing it down the document tree in the capture phase to the element where the event occurred (called its target). Subsequently it then may be passed back up the tree again in the bubbling phase. 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.

Where there are events, actions, handlers, and listeners cannot be far:

HTML 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. This method has two main disadvantages: firstly it hardwires the events into the language, so that to add a new event, you have to make a change to the language, and secondly it forces you to mix the content of the document with the specifications of the scripting and event handling, rather than allowing you to separate them out.

Therefore the XML approach is slightly different...

Produced by Michael Claßen

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

Created: Nov 12, 2001
Revised: Nov 12, 2001