Re: [SMARTY] XML Templates (was RE: [SMARTY] Sections and XHML)
| From: | Ben Godfrey | Date: | Thu, 09 May 2002 03:02:40 +0000 |
| Subject: | Re: [SMARTY] XML Templates (was RE: [SMARTY] Sections and XHML) | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4108@lists.php.net to get a copy of this message | ||
OK, more brain storming...
- Reuse
XML Smarty templates could (within reason) be reused by XSLT-based systems. These systems could fulfill both the role of populating the template and transforming the output. Smarty could also be reimplemented using PHP's XML/XSL features. Monte, as this code is in C would this provide speed increases or other benefits? (not that I'm questioning whether it's fast enough already, I'm just brainstorming). However, Smarty wouldn't need re-implementing and a range of templating engines could be built to work with a (mostly) similar syntax (warning: pipe-dream alert).
- Syntax checking becomes uber-easy, semantic checking tricky as it ever was.
- XML can be spouted by many sources
This is back to middleware, but XML is becoming more and more standard, so there is a larger number of potential template resources that will only produce output that is valid XML.
- Template transformation
Current model would be to populate a template producing XML output and then to transform that into, say, XHTML or WML. If templates were valid XML then that transformation could be performed ahead of time, producing a version for each output grammar required.
Anyway, don't bother to shoot me down on these, I know I'm skating on pretty thin ice. I also suspect that it may not be possible to make all of Smarty's template syntax comply to the XML standard. However, like Gary, I feel that making Smarty XML would be a good bit of future proofing, especially on the tools front. I certainly don't think it would take anything away from the language.
Discuss. ;-)
Ben Godfrey
On Thursday, May 9, 2002, at 03:11 AM, Gary Loescher wrote:
Ben et al, I actually believe that well-formed XML templates would be a _good_ thing. What I was trying to do was open discussion to brainstorm uses to justify the effort. Anyone have any other ideas? So far we have: - template meta-info - documentation generation - easier editing with XML-aware tools - middleware layer through programmatic template manipulation Gary-----Original Message----- From: Ben Godfrey [mailto:ben@hypothetical.co.uk] Sent: Wednesday, May 08, 2002 2:32 PM To: smarty-general@lists.php.net Subject: Re: [SMARTY] Sections and XHML On Wednesday, May 8, 2002, at 07:26 PM, Gary Loescher wrote:-- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpBertrand, The only uses I can think of for XHTML-compliant templates would be to manipulate them programmatically with expat or something, and to store meta-info in the templates themselves. I'm not sure how useful either of those things would be though. You might be able to use it to generate template documentation.And the people who built the original IBM PC thought that 640k was enough. Time has taught us that software always has demands placed on it that were unexpected, fitting in with the crowd by making Smarty XML-like would just be a good idea in that a larger set of tools could be leveraged to manipulate the templates. It strikes me that direct manipulation of the templates might be a good way to allow Smarty to be used as a middleware layer between the web server and some ancient app. If standard XML parser code can be used to build an interface layer then the amount of programming miles can be reduced. I don't know but I thought that the whole point of XML was just to lay down a few ground rules for formatting in structured text documents and, since Smarty falls smack into this category, it just seems like a missed opportunity. IMHO. <rant ends> Ben GodfreyGary-- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-----Original Message----- From: Bertrand DUNOGIER [mailto:bdunogier@wanadoo.fr] MdS> Worse even, the templates can _never_ be xhtml complient, because MdS> they use these strange tags starting with { and ending with }. I MdS> don't think any of that wil be included in the xhtml standard. I still don't see why you want your templates to be XHTML compliant... they are not to be sent "as is" to the browser, so what ? Bertrand-- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php