The solution I have in mind is to create a bunch of XSL templates that the designer would be able to modify without touching any PHP code. PHP would get the appropriate data from the database, generate the XML based on this data, and then display it as XHTML, using something like this code (taken from the php manual):
<?php // Load the XML source $xml = new DOMDocument; $xml->load('collection.xml'); $xsl = new DOMDocument; $xsl->load('collection.xsl'); // Configure the transformer $proc = new XSLTProcessor; $proc->importStyleSheet($xsl); // attach the xsl rules echo $proc->transformToXML($xml); ?>
However, some of the information in my CMS will most likely be private, so I'm wondering if perhaps this isn't the best method to use, as the XML wouldn't be able to be saved on to the web server. Also, would it significantly slower converting it to XML first, and then to XHTML, especially since I don't really *need* the XML on it's own for anything.
Is this a good way of creating a templating system or not? Or would it be better to write my own templating engine from the ground up?