DIGG IT!
5
Comments
Published
Wednesday, May 16, 2007
at
11:55 AM
.
The Flex Directory uses a new technique for delivering Flex RIA via XML/XSL. The base document in the Flex Directory is pure XML with an XSL style sheet, View Source on the directory from the browser. The style sheet located here, writes XHTML/JS to the browser which instantiates a SWF file through SWFObject. This is the next stage of FXT (soon renamed to FXSL) and I snuck it into Flex Directory given cross-browser compatibility. Ted on Twitter - @AdobeTed
Ted on Adobe Groups
Ted on LinkedIn
Ted on Facebook
Ted at Adobe
Neat technique, though I notice you're hitting the XML file twice -- once with the browser and then again with the Flash app. Of course it should be in the browser's cache the second time, so maybe this isn't a big deal.
I do something similar on Xeko.com. All of the page content is in the HTML and is passed to the Flash app as a flashVar and then managed as XML without loading it again. I'd like to port this to Flex/AS3 at some point.
Definitely an interesting technique, it's taking progressive enhancement one step further. Instead of HTML progressed to Flash, it's XML (pure data) progressed to HTML (formatting on data) progressed to Flash (formatting + interaction on data).
However, it works for situations where you want to present a single source of data, like the Flex Directory, for other purposes it's doubtful if it's appropriate.
Hitting the XML twice is not a problem, it's cached the first time (checked with FireBug).
With something like the Flex module for Apache you could write an XSL which transformed the data into an MXML file, which was compiled on the fly for the client. Dunno if that would be useful, but it's an interesting way of doing things, you get separation of data and presentation, but can deliver them as one package anyway.
Actually it is very handy for structured WIKI where the editors are in the template SWF file. That is the use case for which it was originally written. Assume there were 1000 pages with different XML content, yet all pages have a common template XSL. Much more actually possible.
Ted :)
Hi ted, great example.
I was just think if it is possible to render the xml data with css xsl if there is no flash plugin installed.
that will be a great option.
I was wondering if you think this technique would couple well with an framework such as Ruby on Rails. I am very interested in applying this, but i think i need some more details.