Let me clarify, or rather restate...the model is not implemented in raw XML, but rather (in my rudimentary implementation) as a class that inherits from DOMXML. that class builds up a DOM object with whatever data is necessary, and is pushed directly into the xslt processor. I never explicitly dump the dom object to xml as the xsltprocessor handles it. so you're right in saying that XML can't be the model. what i should have said was an xml
document (DomDocument in php5) is used as the model. which technically means that the model is implemented in php. heh, so yeah, scratch that "php is just the controller" statement i made.
I'll agree with most folks that using XSLT isn't a solution to every application out there, not even every web application. i'm personally a fan of it at this point, but that may be because it just feels fresh to me.
Also, to deal with performance, it's fairly easy to build a caching system that serializes the xml document to a file by using either serialize() or just dumping the raw xml to a text file, so successive page hits mostly just deal with XSLT processing. again i know this won't work in every application, especially where content is updated very frequently, but it is pretty nice for sites that have dynamic content that is not updated very often, or
read from much more than it is
written to (ie, contact information, blog entries, etc).
There's an interesting (and old) article at xml.com called
Style-free XSLT Stylesheets that shows how to seperate a majority, if not all, of the html from the xsl stylesheet. i tried a variation of this and ended up with 3 xml documents used during page generation. 1 file that was almost entirely html, with the exception of some custom marker tags (ie, <insert-site-title/>, etc), 1 file that contained all of the xsl templates for matching each custom marker tag, and the xml document with all of content of the site. the site in question had a small control panel for updating content, but after the content was written to the database, it was then pulled out and dumped to an xml file in the site's directory. page hits to the public site never sent any requests to the database, and the DomDocument didn't have to be built up. it was simply read from the "content cache" on the filesystem, transformed using the xml/html template AND the xsl template, and fired back to the client. the turn around time for generating any given page was on average .02s (p3 600mhz, 512mb ram, not much traffic).
There are, of course, plenty of kinks to be worked out and plenty of dark corners to explore. for one, i don't have any real standard for naming the marker tags. right now it's just <insert-whatever/>. namespaces would probably be helpful. regardless, what i've seen has convinced me that xslt a worthwhile pursuit when it comes to handling presentation for my web apps.
-Drew
Bookmarks