Paul Prescod wrote:
Of course Zope must eventually move into the XML world. Zope needs to do templates.
It already does, via DTML.
XSL also does templates.
I would have thought that XSL *was* a template mechanism. What do you mean by "template"?
In fact templates are almost as central to XSL as they are to Zope.
I would say far more so,
I would suggest that Zope should use XSL template syntax for DTML templates as far as is possible.
It appears to me that DTML and XSL represent two very different approaches to solving the same or similar problems. They are both intended for generating text from objects. DTML generates text from Python objects. XSL generates text from XML objects. DTML takes a higly procedural approach. In DTML, you generate text directly. In XSL (as I understand it) you specify a set of rules for applying transformations to XML elements. This is fairly declarative in nature. In the example you gave, you didn't render a specific picture element. Instead, you have a rule for converting picture elements to img tags. Another difference between DTML and XSL is in how content is determined. DTML is typically used to define as well as format content. A DTML document directly specifies data that is often extracted from large object spaces. In XSL, it appears that the content is largely defined by a source document and an XSL "template" simply specifies transformations. Of course, an XSL specification can also filter, so there is some ability to extract, but it is much less direct than with DTML. Given the very different natures of DTML and XSL, I don't see much point in making the syntaxes all that consistent.
In fact, maybe when XSL becomes popular enough, it might make sense to describe the interaction between Zope and the Python runtime in terms of XML transformations.
It may very well. If Zope made it easy to generate XML from Zope (ie Python) objects, then people who like XSL could apply XSL transformations to the resulting XSL, bypassing DTML altogether. In other words, I see XSL as an alternative to DTML, not another form of it. Or, DTML may turn out to be a good tool for generating XML from objects, and then XSL could be applied to DTML output, in which case the two would act in tandem. Jim -- Jim Fulton mailto:jim@digicool.com Technical Director (540) 371-6909 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.