Archive for March, 2007

Sunday, March 18th, 2007

Another approach to indexing/deep linking Flash

Generally, I find XSLT a bit annoying. I know what I want to do and could do it in quarter of an hour in normal code, but with XSLT anything beyond the trivial takes me forever.

Here’s some trivial XSLT that looks like it might be handy in some situations.

It’s hard to index flash, but supposing you have all of your content in external XML documents? It would be nice to link to these pages directly, so that they get indexed by any robots that come your way. If you link to these documents directly, the last thing you would want is to expose the user to the raw XML. This is where XSL stylesheets can be used.

The idea is to reference an XSL stylesheet in the content.xml document:


Download this code: content.xml

The stylesheet file is very simple. No actual transform takes place, we simply build a page that launches the flashplayer, sending the current location.href to the player.


Download this code: transform.xsl

Then in the player we pick up the URL that was sent to us, and we load into an XML instance, and render it.

This approach would work very well with presentation engines, allowing deep linking to any page in a presentation: the user visits the xml page in the browser, the xsl writes a page that starts up the engine, and presents the content of the page. In order to pick up navigation instructions etc, either the content page contains a reference to the next page etc., or the engine retrieves a structure document (perhaps linked from the content, or in a fixed location relative to the main engine).