Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Browser support  





2 Example  





3 Implementations  





4 See also  





5 References  





6 External links  














ECMAScript for XML






Deutsch
Français


Polski
Русский
Українська

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


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.

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[edit]

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[edit]

var 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( var price in sales..@price ) {
  alert( price );
}
delete sales.item[0];
sales.item += <item type="oranges" price="4"/>;
sales.item.(@type == "oranges").@quantity = 4;

Implementations[edit]

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[edit]

References[edit]

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


    Retrieved from "https://en.wikipedia.org/w/index.php?title=ECMAScript_for_XML&oldid=1208857949"

    Categories: 
    XML
    Ecma standards
    Hidden category: 
    Webarchive template wayback links
     



    This page was last edited on 19 February 2024, at 06:48 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki