[
Lists Home |
Date Index |
Thread Index
]
> -----Original Message-----
> From: Rick Jelliffe [mailto:ricko@allette.com.au]
> Sent: 26 March 2003 04:10
> To: xml-dev@lists.xml.org
> Subject: Re: [xml-dev] mischief
>
> ...templates in XML ...
>
> Are they processing instructions or pre-processing instructions?
Either.
It depends on whether the template engine operates at page delivery
time, or offline to generate a (partial) page. Ideally a templating
system should allow this decision to be hidden from the template
author. Pre-processing being a performance optimisation.
I've written systems that operate in both ways.
As far as extending the XML syntax to allow easier creation of
templates, I'm not sure its worthwhile. As always there's a spectrum
of opinion on what constitutes a good templating syntax, but
the two main approaches seem to be:
- do everything with well-formed XML. (JSP is nearly there in
this regard[*]). Obvious benefits from using general purpose tools,
including XSLT, and Schematron to enforce styling.
- don't use XML at all. The argument being that the two syntaxes
should be distinct.
(I tend to favour the all XML route, because I don't have any problems
switching contexts. But I recently wrote some code to migrate a
legacy non-XML templating syntax into well-formed JSP/JSTL and found
that overall it was a lot less readable).
Cheers,
L.
[*] and is another example of dereferencing namespaces to obtain
precisely _one_ expected resource, the tld file.
|