ECMAScript for XML
ECMAScript for XML ( E4X for short ) is a standardized programming language extension for JavaScript and similar languages that follow the ECMAScript standard. The extension makes it possible to use regular XML and HTML elements as a native part of the programming language.
example
With E4X it is possible to set variables in the XML elements. Attributes can also be addressed directly. In JavaScript this looks like this:
var a = 'Wikipedia';
var anchor = <a href="http://wikipedia.org/">{a}</a>;
anchor.@href = 'http://de.wikipedia.org/';
document.write(anchor); // Ergibt: <a href="http://de.wikipedia.org/">Wikipedia</a>
Note the missing quotation marks when assigning values to the variable anchor
.
Implementations and support
E4X is partially implemented in the Gecko engine used by Mozilla Firefox as well as in SpiderMonkey and Rhino . E4X support was completely removed with Mozilla Firefox 21. E4X fully supports the programming and scripting language ActionScript 3 .
standardization
E4X is standardized by Ecma International in the ECMA-357 standard (currently in the second version from December 2005). E4X is also specified by the ISO in ISO / IEC 22537 (currently in the first version from February 2006).
E4X is now (March 2013) obsolete (overtaken by DOM possibilities). JXON is recommended as an alternative.
Web links
- ECMA-357 standard (English)
- ISO / IEC 22537 standard (English)
- Tutorial and documentation for E4X ( Memento from January 29, 2009 in the Internet Archive ) faqts.com (English)
- E4X Mozilla Developer Center (German)
- Brendan Eich: Presentation about E4X
- E4X in the Mozilla Developer Center (English)
- Introducing E4X xml.com - Compare E4X and JSON
- Processing XML with E4X in the Mozilla Developer Center (English)
Individual evidence
- ↑ Introduction to the ECMA-357 standard, online at ecma-international.org ( memento of the original dated November 4, 2013 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. Retrieved September 13, 2011
- ↑ developer.mozilla.org
- ↑ E4X (English) . Mozilla. Retrieved December 9, 2015.