EX4 (ECMAScript for XML)

Firefox 1.5 is bring developers a simple extension to JavaScript that makes XML scripting very simple it’s called EX4 (ECMAScript for XML). E4X support is part of JavaScript 1.6, which is delivered with Firefox 1.5. IE developers might be familiar with XML support through the Microsoft MSXML2 library but E4X is much simpler and easier.

EX4 allows you to access XML document with similar syntax to XPath 1.0. For example: var title = item.title[0].text(); and row.td += <td><a href={url}>{title}</a></td>; td.@style = "margin-left:3em"; more sample here you can even mix with real regular expressions which has been missing on XSLT1.0. E4X XML API reflects attributes in @ namespace you can create a new XML object from a string: var order = new XML("<order/>"); and create an XML wrapper for a DOM object: var doc = new XML(document);. Developer can work on xHTML document as well using EX4 image to access form validations html.body.form.input[0].@name = "firstName";
But now moment of reality, even though this is very nice extension to JavaScript it’s only available for Firefox. I am almost sure that IE7 will be continue with MSXML library and developers needs to wait few more years before IE will improve their JavaScript engine.
Anyway, this is cool new thing for me and I am sure I will find some use for this if nothing else then for Mozilla based applications and cool new Firefox extensions!

More info
Brendan Eich Mozilla E4X presentation

ECMAScript for XML (E4X) Specification

Native XML Comes To Firefox 1.5’s JavaScript

AJAX and scripting Web services with E4X, Part 1 (developerWorks)