E4X (Ecma-357) is an extension to ECMAScript that adds XML literals as first-class primitives. That’s awesome, but with only Mozilla and Adobe support (without V8 and IE support too), E4X is virtually dead from a web developer’s perspective that has to support users with any modern browser.
Personally, I don’t think there is any advantage at all to XML literals.
var el= <foo>bar<baz/></foo>;
is not really noticeably better than:
var el= new XML('<foo>bar<baz/></foo>');
Adding the full (complex!) syntax of XML as basic language syntax is not a win. In fact it has caused grievous security problems in practice.
I want E4X gone, not more of the same.
XML for <SCRIPT> provides a full suite of tools, including:
* A standards-compliant W3C DOM Level 2 processor * An XPath processor * A standards-compliant SAX processor * A simple (classic) DOM processor * Proxies for XML retrieval from any domain * Utilities for XML and application development
XML for <SCRIPT> is Free software and is distrubuted under the terms of the GNU Lesser General Public Licence (LGPL) , an open source license.
The syntax is a subset of E4X, however the API mimics the DOM more closely. On the client side, you can interact with the browser’s DOM directly using XML literals; and on the server side (NodeJS) you can operate on a virtual DOM before flushing to a string.