Complete ECMA357(a.k.a. E4X) parser written in JS

68 views
Skip to first unread message

Yusuke SUZUKI

unread,
May 5, 2013, 2:50:07 AM5/5/13
to js-t...@googlegroups.com
E4X is finally removed from Firefox 21 SpiderMonkey... But E4X revives like a phoenix :)
I created the complete ECMA357, a.k.a. E4X parser on the top of Esprima harmony.

This implements *ALL* ECMA357 features. (NOT partially)
Demo shows that all examples written on ECMA357 spec are parsed correctly, such as,

    var message = <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
           soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
       <soap:Body>
           <m:GetLastTradePrice xmlns:m="http://mycompany.com/stocks">
              <symbol>DIS</symbol>
           </m:GetLastTradePrice>
       </soap:Body>
    </soap:Envelope>
    message.soap::Body.stock::GetLastTradePrice.symbol = "MYCO";

And it also supports SpiderMonkey extension such as function namespace.


I hope that this will help someone that loves E4X.

Regards,
Yusuke Suzuki
Reply all
Reply to author
Forward
0 new messages