ECMAScript for XML

Last updated

ECMAScript for XML (E4X) was the standard ISO/IEC 22537:2006 programming language extension that adds native XML support to ECMAScript (which includes ActionScript, JavaScript, and JScript). The goal was to provide an alternative to DOM interfaces that uses a simpler syntax for accessing XML documents. It also offered a new way of making XML visible. Before the release of E4X, XML was always accessed at an object level. E4X instead treated XML as a primitive (like characters, integers, and booleans). This implied faster access, better support, and acceptance as a building block (data structure) of a program.

Contents

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

The E4X standard was deprecated by the Mozilla Foundation in 2014. [1]

It was withdrawn by ISO/IEC. [2]

Browser support

E4X is supported by Mozilla's Rhino, used in OpenOffice.org and several other projects. It is also supported by Tamarin, the JavaScript engine used in the Flash virtual machine. It is not supported by other common engines like Nitro (Safari), V8 (Google Chrome), Carakan (Opera), Chakra (Internet Explorer and pre-Chromium Edge). [3]

E4X was also supported by SpiderMonkey (used in Firefox and Thunderbird), but has been removed. In Firefox 10, E4X syntax was no longer accepted in SpiderMonkey when ECMAScript 5 "strict mode" is enabled. [4] According to Brendan Eich, "This thus signals start of deprecation for E4X in SpiderMonkey." [5] and "has been disabled by default for webpages (content) in Firefox 17, disabled by default for chrome in Firefox 20, and has been removed in Firefox 21" [6]

Example

varsales=<salesvendor="John"><itemtype="peas"price="4"quantity="6"/><itemtype="carrot"price="3"quantity="10"/><itemtype="chips"price="5"quantity="3"/></sales>;alert(sales.item.(@type=="carrot").@quantity);alert(sales.@vendor);foreach(varpriceinsales..@price){alert(price);}deletesales.item[0];sales.item+=<itemtype="oranges"price="4"/>;sales.item.(@type=="oranges").@quantity=4;

Implementations

The first implementation of E4X was designed by Terry Lucas and John Schneider and appeared in BEA's Weblogic Workshop 7.0 released in February 2002. BEA's implementation was based on Rhino and released before the ECMAScript E4X spec was completed in June 2004. John Schneider wrote an article on the XML extensions in BEA's Workshop at the time.

See also

Related Research Articles

<span class="mw-page-title-main">JavaScript</span> High-level programming language

JavaScript, often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. As of 2024, 98.9% of websites use JavaScript on the client side for webpage behavior, often incorporating third-party libraries. All major web browsers have a dedicated JavaScript engine to execute the code on users' devices.

ECMAScript is a standard for scripting languages, including JavaScript, JScript, and ActionScript. It is best known as a JavaScript standard intended to ensure the interoperability of web pages across different web browsers. It is standardized by Ecma International in the document ECMA-262.

<span class="mw-page-title-main">SpiderMonkey</span> JavaScript and WebAssembly engine maintained by the Mozilla Foundation

SpiderMonkey is an open-source JavaScript and WebAssembly engine by the Mozilla Foundation.

X3D is a set of royalty-free ISO/IEC standards for declaratively representing 3D computer graphics. X3D includes multiple graphics file formats, programming-language API definitions, and run-time specifications for both delivery and integration of interactive network-capable 3D data. X3D version 4.0 has been approved by Web3D Consortium, and is under final review by ISO/IEC as a revised International Standard (IS).

Rhino is a JavaScript engine written fully in Java and managed by the Mozilla Foundation as open source software. It is separate from the SpiderMonkey engine, which is also developed by Mozilla, but written in C++ and used in Mozilla Firefox.

<span class="mw-page-title-main">ActionScript</span> Object-oriented programming language created for the Flash multimedia platform

ActionScript is an object-oriented programming language originally developed by Macromedia Inc.. It is influenced by HyperTalk, the scripting language for HyperCard. It is now an implementation of ECMAScript, though it originally arose as a sibling, both being influenced by HyperTalk. ActionScript code is usually converted to byte-code format by a compiler.

<span class="mw-page-title-main">JSON</span> Open standard file format and data interchange

JSON is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays. It is a common data format with diverse uses in electronic data interchange, including that of web applications with servers.

Netscape Plugin Application Programming Interface (NPAPI) is a deprecated application programming interface (API) for web browser plugins, initially developed for Netscape Navigator 2.0 in 1995 and subsequently adopted by other browsers.

A JavaScript engine is a software component that executes JavaScript code. The first JavaScript engines were mere interpreters, but all relevant modern engines use just-in-time compilation for improved performance.

<span class="mw-page-title-main">Aptana</span> Text editor

Aptana, Inc. is a company that makes web application development tools for use with a variety of programming languages. Aptana's main products include Aptana Studio, Aptana Cloud and Aptana Jaxer.

Tamarin is a discontinued free software virtual machine with just-in-time compilation (JIT) support intended to implement the 4th edition of the ECMAScript (ES4) language standard. Tamarin source code originates from ActionScript Virtual Machine 2 (AVM2) developed by Adobe Systems, as introduced within Adobe Flash Player 9, which implements ActionScript 3 scripting language. ActionScript Virtual Machine 2 was donated as open-source to Mozilla Foundation on November 7, 2006, to develop Tamarin as a high-performance virtual machine, with the support from broad Mozilla community, to be used by Mozilla and Adobe Systems in the next generation of their JavaScript and ActionScript engines with the ultimate aim to unify the scripting languages across web browsers and Adobe Flash platform and ease the development of better performing rich web applications.

<span class="mw-page-title-main">Google Closure Tools</span> JavaScript developer toolkit

Google Closure Tools is a set of tools to help developers build rich web applications with JavaScript. It was developed by Google for use in their web applications such as Gmail, Google Docs and Google Maps. As of 2023, the project had over 230K LOCs not counting the embedded Mozilla Rhino compiler.

A browser speed test is a computer benchmark that scores the performance of a web browser, by measuring the browser's efficiency in completing a predefined list of tasks. In general the testing software is available online, located on a website, where different algorithms are loaded and performed in the browser client. Typical test tasks are rendering and animation, DOM transformations, string operations, mathematical calculations, sorting algorithms, graphic performance tests and memory instructions. Browser speed tests have been used during browser wars to prove superiority of specific web browsers. The popular Acid3 test is no particular speed test but checks browser conformity to web standards.

Nashorn is a JavaScript engine developed in the Java programming language originally by Oracle and later by the OpenJDK Community. It relies on the support for dynamically typed languages on the Java Platform Nashorn has been included with Java 8 through JDK 14.

River Trail is an open-source software engine designed by Intel for executing JavaScript code using parallel computing on multi-core processors.

Mozilla is a free software community founded in 1998 by members of Netscape. The Mozilla community uses, develops, publishes and supports Mozilla products, thereby promoting exclusively free software and open standards, with only minor exceptions. The community is supported institutionally by the non-profit Mozilla Foundation and its tax-paying subsidiary, the Mozilla Corporation.

asm.js is a subset of JavaScript designed to allow computer software written in languages such as C to be run as web applications while maintaining performance characteristics considerably better than standard JavaScript, which is the typical language used for such applications.

ECMAScript is a JavaScript standard developed by Ecma International. Since 2015, major versions have been published every June.

References

  1. "E4X – Archive of obsolete content – MDN". Mozilla. Retrieved 10 September 2014.
  2. "ISO/IEC 22537:2006 — Information technology — ECMAScript for XML (E4X) specification — Status : Withdrawn".
  3. "Issue 30975: Implement E4X Support for scripts and extensions". Google. Retrieved 21 May 2012.
  4. "Firefox 10 for developers". Mozilla. Archived from the original on 5 May 2012. Retrieved 21 May 2012.
  5. "Bug 695577 – E4X syntax should not be accepted in ES5 strict mode". Mozilla. Retrieved 21 May 2012.
  6. "E4X". Mozilla. Retrieved 12 February 2013.
  7. SpiderMonkey 1.6.0 release notes Archived 2009-04-15 at the Wayback Machine
  8. Rhino 1.6R1 Change log
  9. "Acrobat Help / New features summary" . Retrieved 2015-07-16.
  10. "15.008.20082 Planned Update, July 14, 2015" . Retrieved 2015-07-16.