ECMAScript for XML
ECMAScript for XML (E4X) was an extension to ECMAScript (which includes ActionScript, JavaScript, and JScript) to add native support for Extensible Markup Language (XML).[1] The goal was to provide a simpler alternative to the Document Object Model (DOM) interface for accessing XML documents. E4X added XML as a primitive data structure to allow faster and easier access to XML manipulation 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.[1]
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 2003 [3]. BEA's implementation was based on Rhino and released before the ECMAScript E4X spec was completed in June 2004.[citation needed]
Browser support
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][clarification needed]
E4X was supported by the OpenOffice.org software suite.[citation needed]
Example
let sales = <sales vendor="John">
<item type="peas" price="4" quantity="6"/>
<item type="carrot" price="3" quantity="10"/>
<item type="chips" price="5" quantity="3"/>
</sales>;
alert(sales.item.(@type == "carrot").@quantity);
alert(sales.@vendor);
for each(let price in sales..@price) {
alert(price);
}
delete sales.item[0];
sales.item += <item type="oranges" price="4"/>;
sales.item.(@type == "oranges").@quantity = 4;
See also
- JavaScript XML (JSX) – an XML based markup specifically for DOM manipulation
References
- ^ a b "ISO/IEC 22537:2006 Information technology – ECMAscript for XML: E4X specification". International Organization for Standardization. Retrieved 2024-08-17.
- ^ "E4X – Archive of obsolete content – MDN". Mozilla. Archived from the original on 24 July 2014. Retrieved 10 September 2014.
- ^ A version of the BEA website deep down the IT security firm "Adaptavist".'s domain, contains "A PDF of the release notes of BEA Workshop 7.0" (PDF). Archived from the original (PDF) on July 19, 2026.
- ^ "Firefox 10 for developers". Mozilla. Archived from the original on 5 May 2012. Retrieved 21 May 2012.
- ^ "E4X". Mozilla. Archived from the original on 30 September 2013. Retrieved 12 February 2013.
External links
- ECMA-357 (withdrawn first edition, second edition)
- E4X at faqts.com (or via WayBack Machine)
- Slides from 2005 E4X Presentation by Brendan Eich, Mozilla Chief Architect
- E4X at Mozilla Developer Center Archived 2008-04-19 at the Wayback Machine
- Introducing E4X at xml.com: compares E4X and json
- Processing XML with E4X at Mozilla Developer Center
- E4X: Beginner to Advanced at Yahoo Developer Network
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.