Rhino 1.6 R1
Jon Udell's recent weblog, Introduction to E4X, prompted my to take a look at the new release of Rhino.
1.6 R1 RC1, released ten days ago, includes support for ECMAScript for XML (E4X). Believe it or not, although this is the first time I heard about it, the thing is a new international standard for adding native XML support in JavaScript! The BEA geniuses donated the code to Rhino.
It add the following to the JavaScript language:
- A native XML type in JavaScript
- XML literals (to go with string literals and regular expression literals)
- A natural, minimalist XML/Object mapping
- A set of functions and operators for manipulating XML objects.
[weiqi@gao] $ rhino Rhino 1.6 release 1_pre_RC2 2004 09 24 js> var x = <foo attr1="value1">This is a <test/></foo> js> x.@attr1 value1 js> x.test="JOKE" JOKE js> x <foo attr1="value1"> This is a <test>JOKE</test> </foo>
It's nice to see programming languages start to take XML seriously to add direct XML literal support straight into the language.
Now we can have XHTML which may contain JavaScript which may contain XHTML which may contain JavaScript which may contain ...