E4X是一扩展了ECMAScript(JavaScript)的程式语言,它的目标是提供一种使用简洁语法的DOM接口用於访问XML文档。E4X 又称为 ECMA-357 标准,和 ECMA-262 标准一样,是欧洲计算机制造商协会(ECMA)发表.
释疑
ECMAScript for XML (E4X)是一扩展了ECMAScript(JavaScript)的程式语言,它增加本地XML支持,为ECMAScript程序员提供了一种感觉直观的方式来访问XML文档。它的目标是提供一种使用简洁语法的DOM接口用於访问XML文档。
E4X 又称为 ECMA-357 标准,和 ECMA-262 标准一样,是欧洲计算机制造商协会(ECMA)发表.
----------------------------下面这段引用自国外网站,欢迎英语高手翻译一下------------------
is a programming language extension that adds native XML support to ECMAScript (JavaScript). It does this by providing access to the XML document in a form that feels natural for ECMAScript programmers. The goal is to provide an alternative to DOM interfaces that uses a simpler SYNTAX for accessing XML documents. It also offers a new way of making XML visible Before the release of E4X XML was always accessed at an object level. E4X changed that. It treats XML as a primitive (equivalent to a character, integer, or boolean). This implies faster access, better support, and acceptance as a building block (data structure) of a program. E4X is standardized by Ecma International in ECMA-357 standard. The first edition was published in June 2004, the second edition in December 2005.
实现
E4X在(至少部分地)SpiderMonkey(Gecko的JavaScript引擎)和Rhino中实现。 MozillaFirefox是基於Gecko引擎的,所以它可以用E4X运行脚本。该规范相当新,只有1.5版本及以上支持。 Macromedia的ActionScript3脚本语言完整地支持E4X,ActionScript3在2005年末已可用。注意∶为了正确地在Firefox 1.5中运行E4X,你必须在脚本的HTML标签中将类型(type)值後面加入“; e4x=1”字串(例∶\u003cscript type="text/ECMAScript; e4x=1"\u003e)。