There was a lot of excitement about Smarty 3 and its new lexer and how much more power it would give you as a template designer, but when it actually hit the shelves as it were, it was a real disappointment how slow it was. Compiling a template from scratch took well over a second in Smarty 3, whereas the same template in Smarty 2 would take about half a second. Not good.
But it did get me thinking, why do you need to implement a full-blown language parser in PHP when it already has modules like DOMDocument, SimpleXML and the like available to it?
Are there any template engines for PHP that are based on the XML extensions and/or DOMDocument? If so, what is the performance like? If not, then has anybody attempted to write one?
One drawback I can forsee is it would only really be useful for XML-based formats such as XHTML and RSS. For generating other outputs (Non-XML HTML, plain text, CSS, etc) it would potentially be quite problematic, though I'm sure you could get round it with CDATA blocks. Are there any other implications for using XML/DOM for template parsing that I've not considered?