Ecma International has announced unanimous approval of the ECMAScript for XML (E4X) International Standard by the Ecma General Assembly.
The ECMA-357 ECMAScript for XML (E4X) Specification "defines the syntax and semantics of ECMAScript for XML (E4X), a set of programming language extensions adding native XML support to ECMAScript. ECMAScript (ECMA-262 / ISO/IEC 16262) is one of the most widely used programming languages."
E4X "adds native XML datatypes to the ECMAScript language, extends the semantics of familiar ECMAScript operators for manipulating XML objects and adds a small set of new operators for common XML operations, such as searching and filtering. It also adds support for XML literals, namespaces, qualified names and other mechanisms to facilitate XML processing."
The E4X International Standard "provides a simple, familiar, XML programming model that flattens the XML learning curve by leveraging the existing skills and knowledge of one of the largest developer communities worldwide. It reuses familiar programming language concepts, operators and syntax for manipulating XML data, meaning software developers can start creating, navigating and manipulating XML with little to no additional knowledge. E4X reduces code complexity, time to market and revision cycles; decreases XML footprint requirements; and enables looser coupling between code and external data."
The ECMAScript group is currently working on "significant enhancements for future editions of the ECMAScript language, including mechanisms for defining XML types using the XML Schema language and support for classes."
According to the accouncement, the E4X standard "was proposed in Ecma's programming languages Technical Committee (TC39) by a group of companies led by BEA in June 2002. The ECMAScript Task Group (TG1) of this committee immediately agreed and started drafting the specification. ECMA members BEA, IBM, Microsoft, Macromedia, Mozilla, Netscape/AOL and invited experts contributed to the development of the specification.
ECMAScript Task Group has "completed several independent implementations to validate the specification and is already working on the next version of E4X, which will include support for the XML schema language and other type systems. BEA has donated a complete E4X implementation to the Mozilla open source project and expects it be available in August 2004 as Mozilla Rhino 1.6. Ecma International plans to include the E4X feature set as an integral part of ECMAScript Edition 4."
ECMAScript for XML (E4X) Specification. Ecma International. ECMA-357. 1st Edition / June 2004. 107 pages. Editors: John Schneider (BEA/AgileDelta, Lead Editor); Rok Yu (Microsoft, Supporting Editor); Jeff Dyer (Macromedia, Supporting Editor).
E4X Specification contributions from: Steve Adamski (AOL/Netscape), Patrick Beard (AOL/Netscape), Adam Bosworth (BEA), Steve Brandli (BEA), Vikram Dhaneshwar (Microsoft), Brendan Eich (Mozilla Foundation), Nathanial Frietas (palmOne), Gary Grossman (Macromedia), Waldemar Horwat (AOL/Netscape), Ethan Hugg (AgileDelta), Mark Igra (BEA), David Jacobs (MITRE), Alex Khesin (BEA), Terry Lucas (BEA), Milen Nankov (AgileDelta), Brent Noorda (Openwave), Richard Rollman (AgileDelta), Markus Scherer (IBM), Michael Shenfield (RIM), Dan Suciu (University of Washington), Peter Torr (Microsoft), Eric Vasilik (BEA), Herman Venter (Microsoft), Wayne Vicknair (IBM), Roger Weber (BEA).
From the Announcement
The Ecma General Assembly has unanimously approved ECMAScript for XML (E4X) as an international standard (ECMA-357). E4X is a vendor-neutral set of programming language extensions adding native XML support to ECMAScript (ECMA-262, or ISO/IEC 16262), one of the most widely used programming languages.
"I'm proud of what we've accomplished", said John Schneider of AgileDelta, who led the development of the standard representing BEA, "E4X brings the power of simplicity back to XML. It's exciting to see leading application server, browser and mobile device vendors pulling together to make E4X available everywhere developers need it."
"E4X is amazingly intuitive and powerful", said Adam Bosworth, senior Vice President of Advanced Technologies at BEA, "It is a huge improvement over previous methods for dealing with XML and an essential component for manipulating client and server side data in BEA's Alchemy project."
Jan van den Beld, Ecma International Secretary General, commented, "All at Ecma are delighted with this progress. If their constant enquiries are any indication, ECMAScript users too are keen for the standard to evolve. E4X will certainly be a jewel in future revisions of the ECMAScript standard."
Rod Smith, VP, Emerging Technologies - Software Group, IBM commented " Our customers will benefit from ECMAScript for XML. It provides a more intuitive approach to incorporating XML into ECMAScript applications. This powerful scripting technology will encourage new innovation in dynamic HTML-based Internet applications."
"E4X brings even more power and functionality to ECMAScript and shows the strength of open standards," said David Mendels, general manager, Macromedia. "We leverage ECMAScript broadly throughout most of our products and it serves as the foundation for ActionScript, the scripting language for both Macromedia Flash and Macromedia Flex. Continued refinement of this standard ensures our developers are able to use a very familiar language for building rich Internet applications."
Ecma International is a not-for-profit industry association of technology developers, vendors and users and has developed standards for information and communication technology (ICT) and consumer electronics (CE) since 1961. Industry and other experts work together in Ecma which then submits the approved work for approval as ISO, ISO/IEC and ETSI standards.
Ecma is the inventor and main practitioner of "fast tracking" of specifications through the standardization process in Global Standards Bodies like the ISO. In ISO/IEC JTC 1, Ecma has the status of an A-liaison, equivalent to a national body without voting rights. Since its start in 1987, over 196 (more than 80%) of the 232 submissions for fast-track processing in JTC-1 have come from Ecma.
Main areas of standardization include: Scripting and programming languages; Optical and Magnetic storage; High speed interconnects; Safety, Environmental, Acoustical and Electromagnetic product attributes; Enterprise and Proximity Communication and Networking; and File and Volume structures...
Motivation for the E4X Approach
The Rise of XML Processing. Developing software to create, navigate and manipulate XML data is a significant part of every developer's job. Developers are inundated with data encoded in the eXtensible Markup Language (XML). Web pages are increasingly encoded using XML vocabularies, including XHTML and Scalable Vector Graphics (SVG). On mobile devices, data is encoded using the Wireless Markup Language (WML). Web services interact using the Simple Object Access Protocol (SOAP) and are described using the Web Service Description Language (WSDL). Deployment descriptors, project make files and configuration files and now encoded in XML, not to mention an endless list of custom XML vocabularies designed for vertical industries. XML data itself is even described and processed using XML in the form of XML Schemas and XSL Stylesheets.
Current XML Processing Approaches. Current XML processing techniques require ECMAScript programmers to learn and master a complex array of new concepts and programming techniques. The XML programming models often seem heavyweight, complex and unfamiliar for ECMAScript programmers.
The Document Object Model (DOM). One of the most common approaches to processing XML is to use a software package that implements the interfaces defined by the W3C XML DOM (Document Object Model). The XML DOM represents XML data using a general purpose tree abstraction and provides a tree-based API for navigating and manipulating the data (e.g., getParentNode(), getChildNodes(), removeChild(), etc.).
This method of accessing and manipulating data structures is very different from the methods used to access and manipulate native ECMAScript data structures. ECMAScript programmers must learn to write tree navigation algorithms instead of object navigation algorithms. In addition, they have to learn a relatively complex interface hierarchy for interacting with the XML DOM. The resulting XML DOM code is generally harder to read, write, and maintain than code that manipulates native ECMAScript data structures. It is more verbose and often obscures the developer's intent with lengthy tree navigation logic. Consequently, XML DOM programs require more time, knowledge and resources to develop.
The eXtensible Stylesheet Language (XSLT). XSLT is a language for transforming XML documents into other XML documents. Like the XML DOM, it represents XML data using a tree-based abstraction, but also provides an expression language called XPath designed for navigating trees. On top of this, it adds a declarative, rule-based language for matching portions of the input document and generating the output document accordingly.
From this description, it is clear that XSLT's methods for accessing and manipulating data structures are completely different from those used to access and manipulate ECMAScript data structures. Consequently, the XSLT learning curve for ECMAScript programmers is quite steep. In addition to learning a new data model, ECMAScript programmers have to learn a declarative programming model, recursive descent processing model, new expression language, new XML language syntax, and a variety of new programming concepts (templates, patterns, priority rules, etc.). These differences also make XSLT code harder to read, write and maintain for the ECMAScript programmer. In addition, it is not possible to use familiar development environments, debuggers and testing tools with XSLT.
Object Mapping. Several have also tried to navigate and manipulate XML data by mapping it to and from native ECMAScript objects. The idea is to map XML data onto a set of ECMAScript objects, manipulate those objects directly, then map them back to XML. This allows ECMAScript programmers to reuse their knowledge of ECMAScript objects to manipulate XML data.
This is a great idea, but unfortunately it does not work for a wide range of XML processing tasks. Native ECMAScript objects do not preserve the order of the original XML data and order is significant for XML. Not only do XML developers need to preserve the order of XML data, but they also need to control and manipulate the order of XML data. In addition, XML data contains artifacts that are not easily represented by the ECMAScript object model, such as namespaces, attributes, comments, processing instructions and mixed element content.
The E4X Approach. ECMAScript for XML was envisioned to address these problems. E4X extends the ECMAScript object model with native support for XML data. It reuses familiar ECMAScript operators for creating, navigating and manipulating XML, such that anyone who has used ECMAScript is able to start using XML with little or no additional knowledge. The extensions include native XML data types, XML literals (i.e., initialisers) and a small set of new operators useful for common XML operations, such as searching and filtering.
E4X applications are smaller and more intuitive to ECMAScript developers than comparable XSLT or DOM applications. They are easier to read, write and maintain requiring less developer time, skill and specialized knowledge. The net result is reduced code complexity, tighter revision cycles and shorter time to market for Internet applications. In addition, E4X is a lighter weight technology enabling a wide range of mobile applications..." [excerpted from spec Section 5]
- Ecma announcement 2004-07-20: "Ecma International Approves ECMAScript for XML. New International Standard Adds Native XML Support to ECMAScript."
- ECMAScript for XML (E4X) Specification. ECMA-357. 1st Edition / June 2004. [cache]
- Other media: In addition to PDF format, the specification is available on CD-ROM or as paper copy; these may be ordered from firstname.lastname@example.org.
- Related specifications:
- ECMA-357 reference page
- Index to Ecma Standards
- Ecma Standards
- Index to Ecma Technical Reports
- Ecma International web site. "Since 1961 and continuing in full force today, Ecma International facilitates the timely creation of a wide range of global Information and Communications Technology (ICT) and Consumer Electronics (CE) standards..."
- "Web Leaders Agree to Add Native XML to ECMAScript. New ECMA International Standard, ECMAScript for XML (E4X), to Unlock the Power of XML for Web Developers." March 28, 2003.
- "ECMA International Publishes CSTA XML Standard for Web Services Call Control."