[Zope] Syntax: Learning from JSP's problems

Johan Carlsson johanc@torped.se
Tue, 8 Feb 2000 23:33:34 +0100


> > > Still, there
> > > are many times when I'd like to be able to do XSLT-style 
> manipulation of
> > > pages rather than embedding stuff.
> >
> > That's an absolutely brilliant idee!
> 
> If this was a response to the quoted line which precedes it, you either
> didn't know what I meant by XSLT or leapt away on a tangent :-)  I was
> talking about treating an HTML page as a DOM tree, and manipulating it with
> code like:
> 
> doc['mybutton'].setAttribute('value', 'Whee!')
> doc.match('table//p').setContent('This is a paragraph in a table')

Oh, I thought you meant using an XLS sheet to modify the output.
 

> > It would be nice to be able to include inline
> > Python Methods inside a DTML Method/Document
> 
> No! Stop! Aieee! <mantra>separation of code and content. 
> separation of code and content.</mantra>

Oh, well, I see the point.
But I seem to end up doing alote of functional
things in DTML anyway.

On the other hand I always try to put content outside
of templates. Templates aren't content. But I still 
use DTML Methods to implement both Template and Content.

I might add that I usualy use Folders as an abstraction
for documents (containing content, as dtml methods).
And my main template are the index_html (usualy only
one in the root).

I would say <mantra>separation of code, content, and
design...</mantra>

//Johan

 
> I will admit that it would be nice to associate a bunch of small Python
> functions with a Document without having to make a separate Zope 
> object for each function.  Perhaps a PythonMethodLibrary object?  We'll see.