<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Martijn Faassen wrote:<br>
<blockquote
 cite="mid:8928d4e90712200410w763fcacdl2366b87dd29b1921@mail.gmail.com"
 type="cite">
  <pre wrap=""><!---->
The thing to know about XSLT is that it can be used as a template
language much like ZPT, not just as a transformation language.

The idea is that instead of producing a dictionary with data, which
most template languages take, XSLT needs some XML structure. It'll
access this data using xpath. Hopefully the current template language
integration already would allow for a strategy to pass the XML in and
have the template language access it. But if not, we'll need to think
about extending it somehow. I was hoping you could help me think about
this topic of passing the data along.

Perhaps however I'm on the wrong track and the original poster is
aiming for something different?
  </pre>
</blockquote>
Your description is perfectly accurate.&nbsp; <br>
The only real complication with XSLT templating is that it requires XML
rather than using python expressions directly like ZPT.<br>
<br>
I like the idea of having a simple xml() method, <br>
but for me the XML is also coming back from the browser since I make
extensive use of XHR (AJAX)<br>
calls.&nbsp; Therefore I really want a way to transform python to and from
XML easily.&nbsp; <br>
Maybe we need toXML() and fromXML() methods.&nbsp;&nbsp; It gets complex because
you are often dealing<br>
with big graphs of objects.&nbsp; <br>
<br>
That is why I sometimes make the business objects themselves know how to<br>
transform themselves to and from XML as a first step (self-adapters ?)
and then later on on in the process I can<br>
always decouple that via a simple refactoring if needed or desired.<br>
As a matter of taste, I liken that to keeping unit tests inside the
code, as a way to simplify maintenance.<br>
The way I look at it, the XML schema and Python schema are on an equal
footing, and must always be maintained in parallel for each domain
class.<br>
One reason I like ZODB so much is it means I have one fewer schemas to
maintain (no SQL means two schemas instead of three)...<br>
<br>
What I find interesting about Lennart's posting is that he is hinting
at a very advanced approach that we sometimes take<br>
for an application that has hundreds of HTML pages, where we logically
define the layout of each page in XML<br>
and then have a single canonical XSLT multi-stage pipeline that renders
the page and binds the XML data.<br>
But we don't need that kind of sophistication yet.&nbsp; Maybe that could be
done via a multi-adapter approach or something when the time comes.<br>
<br>
--Craeg<br>
<br>
<br>
</body>
</html>