ECMAScript for XML
XML and XMLList objects add some interesting new operators:
- foo..bar produces an XMLList containing all descendent bar tags of foo anywhere in the document.
- foo.@bar produces the attribute named bar in element foo.
- foo.( x == "bar" ) selects all child elements on which the expression evaluates to true.
Maybe most interestingly, E4X "intentionally blurs the distinction between an individual XML object and an XMLList containing only that object", and it allows operations for single XML elements to be applied to XMLLists by simply forward-applying them to all contained elements. This way, an single expression can be used to get a list of multiply nested elements where it would take multiple nested loops otherwise.