Sign In/My Account | View Cart  
advertisement

Article:
 Introducing E4X
Subject: Array programming
Date: 2007-12-01 10:39:36
From: Kurt Cagle
Response to: Array programming

Re Arrr,


This is one of the biggest difficulties I have in getting AJAX developers comfortable with e4x. As a language, e4x looks like JSON, but it acts more like a form of SQL, because you are essentially performing set manipulation rather than object manipulation. This is a not inconsiderable conceptual leap, and one that can even occasionally throw people that are comfortable working with XML.


One way that I like to think about the distinction is that to object JavaScript, applying a list operation on a particular named property will generate an error. Applying the same operation on an E4X will be valid, because any named object exposes both the XML() and XMLList() interfaces - an object is a list of one element.


I'm banking on XQuery becoming increasingly prevalent on that server, which should have as one immediate consequence the resurgence of XML as a messaging format to the client, which means that the ability to work with XML on the client will continue to climb. The tools that exist now - XPath in particular, have received only indifferent support in browsers (one of the big failings that I see in Firefox is that they don't wrap the awful, cumbersome W3C Xpath API in a more convenient package) and to a great extent works in a silo compared to the rest of JavaScript. E4X should help equalize that.



No Previous Message Previous Message Move up to Parent Message Up Next Message No Next Message


Sponsored By: