Achtung: E4X is obsolete. It 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. Use DOMParser/DOMSerializer or a non-native JXON algorithm instead.
E4X is standardized by Ecma International in ECMA-357 standard (currently in its second edition, December 2005).
<!--...-->) are ignored for backwards compatibility with the comment hiding trick, and CDATA sections (
<![CDATA[...]]>) are not parsed as CDATA literals (which leads to a JS syntax error in HTML since HTML's
<script>element produces an implicit CDATA section, and therefore cannot contain explicit CDATA sections).
someone verify the above
Known bugs and limitations
- It is not currently possible to access a DOM object through E4X (Bug 270553)
- E4X doesn't support parsing XML declaration (
- <?xml version=...?>) (see Bug 336551). You may get SyntaxError "xml is a reserved identifier" (despite the XML being in a string).
var response = xmlhttprequest.responseText; // bug 270553 response = response.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>/, ""); // bug 336551 var e4x = new XML(response);
- E4X Tutorial Processing XML with E4X on MDC.
- E4X for templating
- See the list of E4X-related pages on MDC:
- ECMA-357 standard
- Brendan's presentation
- E4X at faqts.com
- E4X quick reference at rephrase.net