E4X – ECMAScript for XML

It is an extension in JavaScript for support of XML extension with JavaScript. By using E4x, it provides easy access for XML document by the DOM interface. It is a server-side technology used in Rhino and SpiderMonkey because these are powerful extensions by all browsers.

Before E4X, it was very difficult and time consuming for reading and writing in XML. In JavaScript, E$X provides XML document as a XML object, which represents XML fragments as a xmlList. E4X supports special kinds of XML objects. This technique is used in client-side programming.

Here is an example:

varstudent=<student>
<studentInfo>
<name>Ali</name></studentInfo>
</student>

If we enter this XML into our JavaScript code, the E4X interpreter will handle it as an XML object in your script.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.237.24