OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Objectifying XML - JavaScript Extensions for XML (E4X) - Comments?

[ Lists Home | Date Index | Thread Index ]
  • To: xml-dev@lists.xml.org
  • Subject: Objectifying XML - JavaScript Extensions for XML (E4X) - Comments?
  • From: Gerald Bauer <gerald.bauer@mac.com>
  • Date: Thu, 21 Jul 2005 10:48:51 -0700
  • User-agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317)


  allow me to highlight the blog story tilted "Objectifying XML - E4X 
for Firefox 1.1" by Kurt Cagle. Kurt writes:

  Sometimes it's the little things that catch you by surprise. Deep 
within the list of the various new features appearing within Firefox 
1.1, there was a short one liner about a new extension to Javascript 
called E4X. I was kind of curious about this, given that there was very 
little else that I could uncover about this, but it turns out the E4X is 
shorthand for ECMAScript for XML, a language extension proposed to the 
ECMA late last summer.

  The principle behind E4X is simple, but very profound. Currently, 
Javascript is rather stupid about XML - if you want to manipulate XML, 
you have to create a set of interfaces and use the W3C DOM and 
frequently some VERY painful treewalking or convoluted XPath calls in 
order to be able to do anything with it. I've long wished that there was 
a simpler mechanism for working with XML, especially as web development 
code is increasingly moving to an XML basis.

  E4X does precisely this. It lets Javascript treat XML as a native 
application type in exactly the same way that Javascript handles 
strings, numbers and regular expressions. However, if this was all that 
E4X did, it'd be not much more useful than DOM.

  Howevever, the other aspect of E4X, the one that is most interesting, 
is the fact that it "objectifies" XML. In other words, it lets you 
convert an XML document into a representation of an object, without 
having to go through the long, involved steps involved in working with DOM.

  More @ 

 What's your take?  Do you see any need for adding XML as a native type 
to scripting or programming languages or are existing APIs such as DOM, 
SAX & friends good enough? Has anyone used E4X already and care to share 
your experience?

- Gerald

PS:  IBM has published an article on E4X titled "AJAX and scripting Web 
services with E4X" online @ 

Vancouver XML Developers Association (VanX) - http://vanx.org


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS