ECMAScript for XML explained

ECMAScript for XML (E4X) was an extension to ECMAScript (which includes ActionScript, JavaScript, and JScript) to add native support for XML.[1] The goal was to provide a simpler alternative to the DOM interface for accessing XML documents. E4X added XML as a primitive data structure to allow for faster access and better support within the language.

E4X was standardized by Ecma International in the ECMA-357 standard. The first edition was published in June 2004 and the second edition in December 2005. However, the E4X standard was deprecated by the Mozilla Foundation in 2014,[2] and it was withdrawn by ISO/IEC in 2021.

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.

Browser support

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

E4X was supported by SpiderMonkey (used in Firefox and Thunderbird). However, E4X was deprecated in Firefox 10[4] and eventually removed in Firefox 21.[5]

E4X was supported by the OpenOffice.org software suite.

Example

var sales = ;

alert(sales.item.(@type

"carrot").@quantity);alert(sales.@vendor);for each(var price in sales..@price) delete sales.item[0];sales.item += ;sales.item.(@type

"oranges").@quantity = 4;

See also

External links

Notes and References

  1. Web site: ISO/IEC 22537:2006 Information technology – ECMAscript for XML: E4X specification . 2024-08-17 . International Organization for Standardization . en.
  2. Web site: E4X – Archive of obsolete content – MDN. Mozilla. 10 September 2014. 24 July 2014. https://web.archive.org/web/20140724100129/https://developer.mozilla.org/en-US/docs/Archive/Web/E4X. dead.
  3. Web site: Issue 30975: Implement E4X Support for scripts and extensions. Google. 21 May 2012.
  4. Web site: Firefox 10 for developers . https://web.archive.org/web/20120505042844/https://developer.mozilla.org/en/Firefox_10_for_developers#JavaScript . 5 May 2012 . 21 May 2012 . Mozilla.
  5. Web site: E4X . https://web.archive.org/web/20130930214422/https://developer.mozilla.org/en-US/docs/E4X . 30 September 2013 . 12 February 2013 . Mozilla.