Reminds me of Action Script 3 which had XML at the core of the language. It was a fun language to work with, but famously failed to become ES4. Oh well, took us 10+ years to arrive close to that with Typescript and JSX.
Also, it sounds like the only browser to ever support it was Firefox? That was probably much more of a limiting factor for adoption.
Its a shame, E4X was really nice
var data:XML = <foo><bar>hello</bar></foo>
and then data was an object instance like you’d expect
However, the XML selector syntax was a godsend. Recursively parsing an XML tree is really a pain. E4X would allow you to do things like:
var foo = someXml..childNodes.@attribute;
I'm not even sure if that would work actually. There were a bunch of operators for doing things like getting a collection of children that all had the same tag so you could work with XML like: <someXml>
<intermediateNodeYouWantToSkip>
<childNode attribute="1" />
<childNode attribute="2" />
<childNode attribute="3" />
<unrelatedNode />
</intermediateNodeYouWantToSkip>
</someXml>
Another post here said people didn't want it, but I don't think that was the real reason it was dropped. There was a lot of drama at the time about Flash in general and a massive debacle about EcmaScript 4 (which ActionScript more or less adopted). There was also the whole XHTML thing happening.Basically JSON as a format won out over XML and ES4/XHTML were ditched. Frankly, a world that revolved around XML/SOAP would have been a nightmare, so I guess killing off the easy processing of XML in JavaScript helped to stave off that potential future. XSS, XSLT and E4X were all casualties.