Entry
What is E4X (ECMAScript for XML)?
What is E4X (ECMAScript for XML)?
What is E4X (ECMAScript for XML)?
Mar 23rd, 2005 05:21
Martin Honnen, http://www.ecma-international.org/news/4xpr-final-2004.htm
The core of the JavaScript language is standardized under the name
ECMAScript as Netscape (and others) used the ECMA International
organization for a fast-track standards development. The current
ECMAScript standard is the ECMAScript Language Specification Edition 3
from 1999
(http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf).
In 2004 an extension to that standard was published, called ECMAScript
for XML (E4X) specification
(http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-357.pdf).
This extension adds native XML support to the language meaning in
addition to types like the Number type, the String type, the Boolean
type, the Object type there is the XML type for representing XML
elements, attributes, comments, processing-instructions or text nodes
and there is the XMLList type for representing list of XML objects.
There are the additional native objects XML (to create objects of type
XML), XMLList (to create lists of XML objects), Namespace (to create
Namespace objects) and QName (to create qualified name objects).
XML objects and XMLList objects can also be created by literals
respectively initializers, much like objects or arrays or regular
expression objects in ECMAScript.
So far two ECMAScript implementations available have been extended to
implement E4X, the Mozilla JavaScript engines Spidermonkey (C
implemenation that is used in the Mozilla browser) and Rhino (Java
implementation: http://www.mozilla.org/rhino/download.html).