XSL in Adobe AIR
Brian Riggs shows us how to perform client-side XSL/XSLT in an AIR application. Thanks to Brian for shining light on this, and thanks to Mike Chambers for sharing the link on Twitter today. Brian’s post is from May, so many of you may have already seen it.
The solution Brian outlines requires JavaScript because the only XSL toolkit AIR provides is inside of the WebKit HTML rendering engine. Consequently, AIR developers working with the Flash or Flex APIs will need to use an ActionScript-JavaScript bridge. Brian provides a nice code snippet showing how to create that bridge. Great, but still a kludge.
Unfortunately, XSL doesn’t seem to have made it into the Gumbo API for the next version of Flex and AIR. There is also no mention of XSL in Mike Chambers’ September post about AIR 1.5. I have not had an opportunity to pull down a recent nightly build of the Flex trunk to verify that the ActionScript API for AIR continues to lack XSL support, but all indications are that XSL is not present.
A little bit of Googling indicates that I am not alone in desiring XSL capabilities in AIR that do not require a bridge to JavaScript. I know that XSL is not like the hot stuff that Adobe like to tout in its products (OLAP only made it in because of its use in visualization), but it’s a real asset for enterprise developers.
I suspect that Adobe’s plan may be to leave out XSL—and a lot of other large-but-niche APIs—and let teams needing those capabilities include them with FlaCC, the upcoming C/C++ to Flash byte code compiler. (More info about FlaCC, including links to slides and a hi-res presentation video is available here). Specifically, for XSL, Xalan and Xerces could be imported. In truth, I find this to be an attractive solution, in part because I’m sure someone else will go through the hassle of compiling the popular C/C++ libraries to SWCs for me—I will only need drop those into my project.
However, if you are an AIR developer who cannot wait for FlaCC or want to see XSL make it into AIR’s officialy ActionScript API, consider submitting an enhancement request.