Support for E4X

21 views
Skip to first unread message

Andrew Fleming

unread,
Nov 16, 2011, 5:23:21 PM11/16/11
to Jangaroo Users
Hey!

First of all, thanks for the superb work you guys have done with this.
I'm really excited about the thoughts of converting our existing
programs into HTML/JS.

Our big (huge) problem is, our data is all in XML files, so therefore
E4X/XML is very tightly interwoven into our programs. What are the
current thoughts on porting over E4X support?

Thanks!
Andrew

Frank

unread,
Nov 16, 2011, 5:47:03 PM11/16/11
to Jangaroo Users
Hi Andrew,
thanks for the positive feedback, we appreciate it!

> Our big (huge) problem is, our data is all in XML files, so therefore
> E4X/XML is very tightly interwoven into our programs. What are the
> current thoughts on porting over E4X support?

It consists of two tasks:
* teach the compiler the intricacies of parsing E4X syntax
* for all browsers *but* Firefox (which supports E4X natively),
implement
the E4X runtime capabilities and generate code that calls this
library

We wouldn't start the first task unless we are sure we can do the
second one. There have been attempts to implement E4X for
other browsers before, but the only concrete thing I could find
is this project which seems to have died in 2008:
http://sourceforge.net/projects/iee4x/files/iee4x/

Anyone got a better code base for the E4X functionality?
Maybe we could port the Firefox implementation, from C++
(I assume) to AS3?

E4X is very powerful, it can do selector / XPath-like things,
parse XML syntax with parameters, and so on. So I'm afraid
both tasks mentioned above are quite hard to achieve.

So far, Jangaroo does not generate browser-specific code, which
I think is a great advantage, as it simplifies deployment.
One thing that bothers me is that this would make it almost
impossible to reuse Firefox' native support for E4X, and using
a custom implementation in Firefox would be doing it in
a roundabout fashion...

So one last question, would a solution that just worked in
Firefox be of any help in your special case?

My 5 cents,

-Frank-

Andrew Fleming

unread,
Nov 16, 2011, 6:01:07 PM11/16/11
to Jangaroo Users
I very much like the direction that Jangaroo is moving in, producing
code that is usable in all browsers - thats a feat in and of itself!

But yes, we'd have to have support in all browsers, and thats a pain.
I now know a lot more about the E4X standard and such, and that'll
help me suggest to my employers where we need to go from here. You
wouldn't have any other ideas that I could try? They would like to try
to move away from Flash of course, but I don't see anyway to do that
other than redeveloping everything from scratch.

Frank

unread,
Nov 16, 2011, 6:10:04 PM11/16/11
to Jangaroo Users
As an Open Source project, it is good style to point you at the
competition:
Adobe just announced a Flex-to-HTML/JavaScript compiler called Falcon
JS for 2012 (see other post here in jangaroo-users).
The guys as realaxy claim on Twitter that they will be supporting AS-
to-JS including E4X:
http://twitter.com/#!/potapenko/statuses/136894048958033920
But like Jangaroo, both have not yet actually delivered this feature.
Sorry that I have no better news for you, but there have been requests
from the community to let Jangaroo support E4X before, so maybe
someone will help out? I guess the parsing part wouldn't be such a big
problem for Andreas, but the E4X client implementation is the key.
Reply all
Reply to author
Forward
0 new messages