Opentopia Directory Encyclopedia Tools

E4X

Encyclopedia : E : E4 : E4X : E4X



 

ECMAScript for XML (E4X) is a programming language extension that adds native XML support to ECMAScript (JavaScript). It does this by providing access to the XML document in a form that feels natural for ECMAScript programmers. The goal is to provide an alternative to DOM interfaces that uses a simpler syntax for accessing XML documents. It also offers a new way of making XML visible. Before the release of E4X XML was always accessed at an object level. E4X changed that. It treats XML as a primitive (equivalent to a character, integer, or boolean). This implies faster access, better support, and acceptance as a building block (data structure) of a program.

E4X is standardized by Ecma International in [ECMA-357 standard]. The first edition was published in June 2004, the second edition in December 2005.

Implementations

E4X is implemented (at least partially) in SpiderMonkey (Gecko's JavaScript engine) and in Rhino.

As Mozilla Firefox is based on Gecko, it can be used to run scripts using E4X. The specification is relatively new and is only supported in the 1.5 release or later.

Note: To correctly run a script using Firefox 1.5 you must append "; e4x=1" to the end of the script type tag (ex.

E-mail this article to:

Personal Message: