[ZPT] Confused about Zope

Chris Withers chrisw@nipltd.com
Wed, 05 Mar 2003 12:07:49 +0000


Shane Hathaway wrote:
>> Sorry, that should have read:
>> <tal:x replace="options/sql.string:x"/>
>>
>> ...so you know for definite where x is coming from.
> 
> FWIW, I think I'd want to write it like this:
> 
> <tal:x replace="options/x/sql:string" />
> 
> The idea is that after you've retrieved the value of "x" from the 
> options, you invoke the "string" method of the SQL formatting API to 
> make the database understand that the value is a string.

Yes, but I though that was spelled as I put it, it certainly seems to make more 
sense to me and was the last suggesteion I nodded vigorously to on 
zope3-dev@zope.org... has something changed since then?

> Here's an idea, though.  In contexts like ZSQL methods, we specifically 
> don't care about XML format, so the "tal:x" is what Jim calls a "dead 
> chicken", or in other words, a meaningless sacrifice. :-)  At the same 
> time, we don't want to stray far from TAL, so that no one has to learn 
> something new.  So what if, in non-XML TAL, we chopped off the tag name? 
>  We could write the above expression in a slightly more logical way:
> 
> <tal:replace="options/x/sql:string"/>
> 
> I'm tempted to also say that all tags should automatically use the TAL 
> namespace, so then we could make it a little shorter and cleaner:
> 
> <replace="options/x/sql:string"/>
> 
> Opinions?

This is all a big NO from me I'm afraid. What you've done, while convenient, 
changes the syntax enough that it's not ZPT. My key driver in all of this is to 
only have to have enwbies learn one templating language to use Zope. For me 
tal:x isn't paltry (or even poultry ;-), it allows people to see and use the 
same sytnax for different purposes.

 From a code maintenence point of view, it also means only one engine has to be 
maintained to parse all this.

Now, that said, I would be extremely interested in beign able to use your 
suggested syntax in all ZPT's when XML conformance of the template source isn't 
required. But that would be quite controversial ;-)

cheers,

Chris

> 
> Shane
> 
>