XML Events

XML Events

XML Events is a W3C specification for handling events occurring in an XML document. These events are typically caused by a user interacting with the document as a web page using a device such as a web browser on a PC, mobile phone or telephone.

Formal Definition

Technically an XML event is the representation of some asynchronous occurrence (such as a mouse click on a button) that gets associated with any data element in an XML document. XML Events provides a static, syntactic binding to the DOM Events interface, allowing the event to be handled.

Motivation

The XML Events standard is defined to provide XML-based languages with the ability to uniformly integrate event listeners and associated event handlers with Document Object Model (DOM) Level 2 event interfaces. The result is to provide a declarative, interoperable way of associating behaviors with XML-based documents such as XHTML.

Advantages of XML Events

XML Events uses a separation of concerns design pattern, and is technology neutral with regards to handlers. It gives authors freedom in organising their code, and allows separation of document content from scripting.

Both legacy HTML and early SVG versions bind events to a presentation 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. For example (with the "onclick" attribute):

Stay here!

This design has three drawbacks:
# it hard-wires the events into the language, so that to add a new event type, you have to make a change to the language
# it forces software developers to mix the content of the document with the specifications of the scripting and event handling, rather than allowing you to separate them out
# it restricts you to a single scripting language per document.

Relationship to Other Standards

Unlike DOM Events which are usually associated with HTML documents, XML events are designed to be independent of devices. XML Events are also used extensively in XForms, and in version 1.2 of the SVG specification, as of July 2006 still a working draft.

Example of XML Events using Listener in XForms

The following is an example of how XML events are used in the XForms specification:

...

In this example, when the DOMActivate event occurs on the data element with an id attribute of myButton, the handler doit (for example a javascript script element) is executed.

ee also

* ECMAScript
* DOM Events
* XForms
* XHTML

External links

* [http://www.w3.org/TR/xml-events W3C XML Events Specification] was a [http://www.w3.org/TR/2003/REC-xml-events-20031014/ W3C Recommendation on 14 October 2003]
* [http://www.w3.org/MarkUp/2004/xmlevents-for-html-authors W3C XML Events for HTML Authors] tutorial


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • XML Events — ist eine Spezifikation des W3C, um Ereignisse, die in einem XML Dokument auftreten, zu handhaben. Diese Ereignisse werden typischerweise durch einen Benutzer ausgelöst, der mit dem Dokument, einer Webseite, mit Hilfe eines Internetbrowsers auf… …   Deutsch Wikipedia

  • XML-Schema — ist eine Empfehlung des W3C zum Definieren von Strukturen für XML Dokumente. Anders als bei den klassischen XML DTDs wird die Struktur in Form eines XML Dokuments beschrieben. Darüber hinaus wird eine große Anzahl von Datentypen unterstützt.… …   Deutsch Wikipedia

  • XML Schema Definition — XML Schema ist eine Empfehlung des W3C zum Definieren von Strukturen für XML Dokumente. Anders als bei den klassischen XML DTDs wird die Struktur in Form eines XML Dokuments beschrieben. Darüber hinaus wird eine große Anzahl von Datentypen… …   Deutsch Wikipedia

  • Xml — (англ. eXtensible Markup Language) расширяемый язык разметки Расширение файла: .xml Тип text/xml (устаревший) Разработчик: World Wide Web Consortium Расширение для: Основа для: SVG, XSL …   Википедия

  • XML Schema — XML Schema, abgekürzt XSD, ist eine Empfehlung des W3C zum Definieren von Strukturen für XML Dokumente. Anders als bei den klassischen XML DTDs wird die Struktur in Form eines XML Dokuments beschrieben. Darüber hinaus wird eine große Anzahl von… …   Deutsch Wikipedia

  • XML Base — ist eine vom World Wide Web Consortium empfohlene Möglichkeit, Basis URLs für Teile von XML Dokumenten zu definieren. Basis URL bezeichnet dabei diejenige URL, von der aus relative Pfadangaben im Dokument aufgelöst werden. Die XML Base Empfehlung …   Deutsch Wikipedia

  • XML Schema (W3C) — XML Schema один из языков описания структуры XML Schema получила статус рекомендации Консорциума W3C 2 мая 2001 года, став первым стандартом описания XML, получившим статус рекомендации. Как большинство языков описания XML, XML Schema была… …   Википедия

  • XML-binary Optimized Packaging — (XOP) ist eine W3C Empfehlung für die Repräsentation binärer Daten in XML Dokumenten. XOP ersetzt damit die sonst für die Repräsentation binärer Daten in XML Dokumenten üblichen Techniken wie Verwendung von CDATA Blöcken, Base64 Kodierung, SOAP… …   Deutsch Wikipedia

  • XML Information Set — (Infoset) ist ein W3C Standard mit dem Status einer Empfehlung. Die Infoset Spezifikation dient als Basis für eine Reihe anderer Spezifikationen, welche Aussagen zum formellen Informationsgehalt von XML Dokumenten zu machen haben. Ein… …   Deutsch Wikipedia

  • XML DOM — Пример иерархии объектов в HTML DOM DOM (от англ. Document Object Model  «объектная модель документа»)  это независящий от платформы и языка программный интерфейс, позволяющий программам и скриптам получить доступ к содержимому документов, а… …   Википедия

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”