Adobe AIR WebKit Doesn't Support Client-side XSLT?

Posted on Aug 31, 2007

I got on a weird mission today for no specific reason (ok, I had something in mind but since it may not be possible I won't go into details). What I wanted to know was whether I could do an XSL Transform within Adobe AIR either through ActionScript 3, JavaScript or otherwise. After a little research, it appears that AS3 doesn't support XSLT directly. In addition, WebKit has added an XSLT JavaScript API but it seems to be new and, to be honest, I couldn't locate anything showing how to implement it.

After those two paths were blocked, I found an excellent beginners tutorial on client-side XSLT simply by loading the XML with the defined XSL template in the browser. The example they gave worked nicely in IE7, Firefox and even Safari on Windows. Seeing as Safari and AIR both use WebKit, I thought this might work in AIR. To my dismay, it did not. Here's what I did...Using Aptana which has awesome built-in AIR support, I created a simple AIR application. Rather than use the standard HTML default page, I changed the rootContent to use the books.xml from the example cited earlier like so:

<rootContent height="480" systemChrome="standard" transparent="false" visible="true" width="640">books.xml</rootContent>

I then stuck the XSL the books.xml cites as its stylesheet in the root of the application as well. It uses relative pathing, so one thought is that perhaps I goofed up there. Here is the XML:

<?xml version="1.0" encoding="utf-8" ?> <?xml-stylesheet type="text/xsl" href="books.xsl"?> <books> <book> <author>Roth, Philip </author> <title>American Pastoral</title> </book> <book> <author>Hesse, Hermann</author> <title>The Glass Bead Game</title> </book> </books>

The net result is that when I run it, I get a window that says:

Roth, Philip Hesse, Hermann

Rather than one that looks like:

Some Good Books

  • The Glass Bead Game by Hesse, Hermann
  • American Pastoral by Roth, Philip

So, am I doing something wrong inasmuch as this needs to work differently in AIR than in a browser? Or does AIR not support the XSL transformations built into WebKit? If not, with AS3 not having XSLT (that I know of), is there any way to directly support it in an AIR application at the current time? If not, I think there should be.


Paulius Uza All that I can tell you is that this will be fixed very soon ;) (wink)

Posted By Paulius Uza / Posted on 08/31/2007 at 11:41 AM

mike chambers XSLT will be enabled in next public build.

mike chambers

Posted By mike chambers / Posted on 08/31/2007 at 11:47 AM

Michael Repplinger You know your blog made it when you post about the product of a company, and receive comments by developers of said company.

Posted By Michael Repplinger / Posted on 09/01/2007 at 1:19 PM

Brian Rinaldi Good to hear. Thanks for confirming it wasn't something I was doing wrong :)

Posted By Brian Rinaldi / Posted on 09/02/2007 at 5:39 AM

patrick @mike : When will the next public build be out? Also, re "...XSLT will be enabled..." is there any documentation on how to use it? Will it be enabled via WebKit JavaScript or will it have a built in transformer?

Posted By patrick / Posted on 10/05/2007 at 8:00 AM

ryan i'm thinking of developing a uml editor and using describeType() then sending that to the webkit xslt processor and having clean valid uml returned...

bit of a hack but could be done quite easy i believe after reading this post...

i'll have to experiment with this feature though...

Posted By ryan / Posted on 12/19/2008 at 9:24 AM

Write your comment

(it will not be displayed)


My name is Brian Rinaldi and I am the Web Community Manager for Flash Platform at Adobe. I am a regular blogger, speaker and author. I also founded RIA Unleashed conference in Boston. The views expressed on this site are my own & not those of my employer.