We have developed a series of xhtml templates for a client. Now, on one of the templates, they are going to be using a Flash movie, which itself is going to use XML for all of it's content. Thats fine. Now, they want to be able to use the same XML doc to display content to non-Flash pages (users with no Flash) so that they see the same content.
In these pages, they want to use the same header, footer, top nav etc, but only have the content from the XML display in the main part of the page.
I have little to no experience with XSL, and the only real experience I have with XML is creating XML with PHP from a db, so do not really know where to start with displaying and formatting this content.
I have read about data islands, but these are only compatible with IE as far as I can tell.
They are really keen on using the method mentioned above, as it would mean they only need to edit one XML file, but I think that is working backwards. I personally think the best solution is to store all the data in the database, and have it output XML in the format they desire for the Flash to use, and then output pure xhtml for the alternative content.
Is it possible to format XML in an xhtml doc, whilst maintaining all the other xhtml page elements (header, footer etc) and still have valid (xhml strict) pages?
If so, could somebody please advise as to how to go about this, or at least some starting points? I have used W3Schools' site a bit to see what it is all about, and can format a pure XML doc using xsl fine from their examples, but the problem arises when trying to incorporate it into the existing templates.
I'm not sure I understand your question 100%, but here is my experience with xml+xsl.
If you want to integrate parts of a web page from an xml source, then you will need to generate an html fragment on the server, get it back and insert it into the html page.
Basically, an xslt engine can transform any xml file in html (not xhtml, or not w3c valid xhtml to be precise) by using an xsl stylesheet.
An xsl stylesheet, is nothing more than a template, with some logical elements that will give instructions to the engine about which xml element should be placed where, on which xml elements to do loop and so on...
I personally designed a couple of sites using this technique, and I like it a lot, but it has it's drawback.
Now, if you have to go that way, there are some thing you need to know:
1) not every browser are able to transform xml+xsl natively. To support everyone, you must have an xslt engine on the server to do the transformation and serve html to the client
If this can make your life easier, I've implemented and mostly automated all of this in a class I released some times ago: http://www.quixml.org
It requires PHP5 with xmlWriter and the xslt engine to be available for PHP.
If you want to see xml+xsl in action, go to this site with firefox, and look at the source.
You will onyl see XML (IE cannot display source xml).
You will see a reference to an xsl stylesheet at the top, and if you try to go to that url, you will see the stylesheet that is used by the browser to generate the html of that page.
If you try to access this site with something like netcape 4, the server will detect that the browser is too old to support xslt transformation, and do it itself, to send plain simple html to the browser.