<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brian Riggs</title>
	<atom:link href="http://blogs.adobe.com/briggs/feed" rel="self" type="application/rss+xml" />
	<link>http://blogs.adobe.com/briggs</link>
	<description>On building a next-gen media player on AIR...</description>
	<lastBuildDate>Thu, 08 Jul 2010 17:51:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Using AIR for XSLT Processing</title>
		<link>http://blogs.adobe.com/briggs/2008/05/using_air_for_xslt_processing.html</link>
		<comments>http://blogs.adobe.com/briggs/2008/05/using_air_for_xslt_processing.html#comments</comments>
		<pubDate>Sun, 11 May 2008 17:03:25 +0000</pubDate>
		<dc:creator>Brian Riggs</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/briggs/2008/05/using_air_for_xslt_processing.html</guid>
		<description><![CDATA[air xslt One of the features we&#8217;re investigating for the next version of the media player requires that we be able to do client-side XSL transformations.&#160; I had heard a few rumors that AIR exposes the XSLT processor that&#8217;s built &#8230; <a href="http://blogs.adobe.com/briggs/2008/05/using_air_for_xslt_processing.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><!-- #BeginTags -->
<p class="tags"><a href="http://www.technorati.com/tag/air xslt" rel="tag">air xslt</a></p>
<p><!-- #EndTags --></p>
<p>One of the features we&#8217;re investigating for the next version of the media player requires that we be able to do client-side XSL transformations.&#160; I had heard a few rumors that AIR exposes the XSLT processor that&#8217;s built into WebKit (which is AIR&#8217;s embedded HTML engine), so I shot off a couple of emails to the AIR team.&#160; Sure enough, this functionality is exposed through AIR&#8217;s Javascript API. </p>
<p>Here&#8217;s a Javascript method that takes an XML document, an XSL transformation, and returns the result of transforming the document:</p>
<blockquote>
<pre>
function transformXML(xml,xsl)
{
var domParser = new DOMParser();
var xmlObject = domParser.parseFromString(xml,"text/xml");
var xslObject = domParser.parseFromString(xsl,"text/xml");
var xsltProcessor = new XSLTProcessor();
xsltProcessor.importStylesheet(xslObject);
var result = xsltProcessor.transformToFragment(
xmlObject,document);
var serializer = new XMLSerializer();
return serializer.serializeToString(result);
}
</pre>
</blockquote>
<p>If you&#8217;re building a pure-Javascript AIR app, then this is probably all you need.&#160; But if you want to use this functionality in an ActionScript-based AIR app, then there&#8217;s one small problem:&#160; WebKit&#8217;s API isn&#8217;t available in ActionScript!&#160; Fortunately, there&#8217;s a workaround: use the script bridging capabilities of AIR to call a Javascript function from ActionScript.&#160;First, you create a new instance of an HTMLLoader and pass in the URL of the HTML file that contains the transformXML function:</p>
<blockquote>
<pre>var html:HTMLLoader = new HTMLLoader();
var urlReq:URLRequest = new URLRequest("xslt.html");
html.load(urlReq);
</pre>
</blockquote>
<p>Then invoke the transformXML method via the HTMLLoader&#8217;s window property:</p>
<blockquote>
<pre>
var result:String = html.window.transformXML(xml,xsl);
</pre>
</blockquote>
<p>Here&#8217;s <a href="http://blogs.adobe.com/briggs/XSLTApp.air">a simple AIR app</a> that demonstrates this.&#160; Just enter some XML in the top text box, an XSLT in the second text box, click &#8220;Process&#8221;, and you&#8217;ll see the output in the lower text box.&#160; Right click on the application to see source code.    </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/briggs/2008/05/using_air_for_xslt_processing.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Opening Credits</title>
		<link>http://blogs.adobe.com/briggs/2008/05/opening_credits.html</link>
		<comments>http://blogs.adobe.com/briggs/2008/05/opening_credits.html#comments</comments>
		<pubDate>Sun, 11 May 2008 14:11:51 +0000</pubDate>
		<dc:creator>Brian Riggs</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/briggs/2008/05/opening_credits.html</guid>
		<description><![CDATA[Here&#8217;s my intro, short and sweet.&#160; My name is Brian Riggs, and I&#8217;m the lead engineer for the Adobe Media Player project.&#160; For the last year and a half, our team has been heads-down on development, but now that the &#8230; <a href="http://blogs.adobe.com/briggs/2008/05/opening_credits.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s my intro, short and sweet.&#160; My name is Brian Riggs, and I&#8217;m the lead engineer for the <a href="http://www.adobe.com/products/mediaplayer/">Adobe Media Player</a> project.&#160; For the last year and a half, our team has been heads-down on development, but now that the media player has actually shipped (woohoo!), I&#8217;ve got a little bit more free time on my hands.&#160; I&#8217;m planning to use this blog to share my thoughts on developing on Flex and AIR.</p>
<p><a href="http://www.adobe.com/products/air/">AIR</a> is an insanely cool platform on which to build a rich internet application.&#160;It boggles my mind that you can build and deploy an application that works on Windows, Mac, and (soon) Linux without writing any platform-specific code and without having to create any installers.&#160; For these reasons alone, AIR is probably the best technology I&#8217;ve seen for creating one-off demo apps and proofs of concept.&#160; And the combination of Flex/Flash with HTML/Javascript opens up some very interesting possibilities. </p>
<p>I&#8217;m also hoping to talk about some of the interesting features in the media player, and how we implemented them.&#160; Speaking of the media player, anyone notice that  The Daily Show and The Colbert Report are now available?<BR /></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/briggs/2008/05/opening_credits.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
