ECMAScript for XML (E4X)


Saw a link to E4X yesterday, but nobody seemed to know what E4X really was, only that they had a very PR-ish PR.

Sean Corfield, over at An Architect's View, has provided some more info. Basically E4X provides a more complete DOM, with methods to read, create, and query an XML document (including an XQuery implementation).

Also, it appears that E4X has grown from BEA's scripting extensions, so it's not a brand new thing - that's good, in that it's been in the wild for a while, rather than being restricted to the lab.

Bookmarking this, in case it comes in handy for the Pachyderm flash templates...


var over27inEng = empdoc..employee.(department.@id == 500 && age > 27);

This will return all employee nodes (like //employee in XPath) which have:

  • a department child with an id attribute equal to 500 and
  • an age child with a value greater than 27

flash 

See Also