Ted Patrick > { Events & Community } > Adobe Systems


Flex over XML/XSL

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.

I like the design because it is easy to update. Presentation and data are 100% separate and the UI can support RIA behavior without munging the data with presentation. Once the SWF file is instantiated it has instant access to the XML data. In the current design there are 2 API calls made to support the forms logic and soon some advanced features.

What is pretty cool is that any type of XML can be handled this way including RSS,ATOM and others.

More to come!

Ted :)

5 Responses to “ Flex over XML/XSL ”

  1. # Blogger endquote

    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.  

  2. # Blogger Theo

    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.  

  3. # Blogger Ted Patrick

    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 :)  

  4. # Blogger Hasan Sabir Sujon

    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.  

  5. # Blogger Michael

    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.  

Post a Comment



Jobs


Flex Jobs
city, state, zip


© 2008 Ted On Flash