Remote Synthesis
Search my blog:
Viewing By Entry / Main
Aug 31, 2007

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

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.

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


mike chambers
XSLT will be enabled in next public build.

mike chambers

mesh@adobe.com


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.


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


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


Write your comment



(it will not be displayed)