Easy Tutorial
❮ Xml View Xml Elements ❯

XML- E4X


E4X adds direct XML support to JavaScript.


E4X Example

This example only works in Firefox!

Try it »


XML as a JavaScript Object

E4X is an official JavaScript standard that adds direct support for XML.

With E4X, you can declare XML object variables the same way you declare Date or Array object variables:


E4X is an ECMAScript (JavaScript) Standard

ECMAScript is the official name for JavaScript. ECMA-262 (JavaScript 1.3) was standardized in December 1999.

E4X is an extension to JavaScript that adds direct support for XML. ECMA-357 (E4X) was standardized in June 2004.

The ECMA organization (founded in 1961) is dedicated to standardizing information and communication technology (ICT) and consumer electronics (CE). Standards set by ECMA include:


Without E4X

The following example is cross-browser. It loads an existing XML document ("note.xml") into an XML parser and displays a message:

Example


With E4X

The following example is the same as the one above but uses E4X:

Much simpler, isn't it?


Browser Support


The Future of E4X

E4X has not gained widespread support. Perhaps it offers too few practical features that are not covered by other solutions:

❮ Xml View Xml Elements ❯