Quality E4X articles

Unfortunately E4X documentation is very thin on the ground, even on the official Mozilla Rhino site, which has left a lot of developers either scrabbling through source code or relying on examples.

An invaluable article on the principles and practice of E4X can be found on the DevX site.

In particular:

  • Page 2 provides a summary of the new syntax and operators available (for each ... in, *, .., etc.)
  • Page 3 lists properties and methods available to manipulate XML objects
  • Page 4 lists Global properties and methods available by querying the XML object
  • One method curiously left off the list of Page 4 which I find useful for debugging is XML.settings(). The following snippet will show you the current status of the XML engine:

      for (var i in XML.settings()) {
        print(i + ": " + XML.settings()[i]);