[Zope] <% ... %> ?

Jim Fulton jim@digicool.com
Tue, 15 Jun 1999 08:18:24 -0400


Alexander Staubo wrote:
> 
> Very lucid and intelligent discussion, Paul. As an eager fan of XML, I
> second the idea to push XHTML as the next-generation Zope DTML syntax.
> 
> If this is the goal, the "tag" syntax currently used by Zope can be
> preserved, with some modifications.
> 
> I've jotted down a few examples of how such a modified syntax might
> look, at least as I see it. At least this is one possible angle. (Note:
> Best read in a monospaced font.)
> 
>   XML syntax::                             Equivalent legacy syntax::
> 
>   <zope:tree expr="PARENTS[-1]">           <!--#tree
> expr="PARENTS[-1]"-->
>     ... stuff ...                           ... stuff ...
>   </zope:tree>                             <!--#/tree-->
> 
>   <zope:var expr="id()"/>                  <!--#var expr="id()"-->
> 
>   <zope:var obj="standard_html_header"/>   <!--#var
> standard_html_header-->

This is already handled by the name attribute:

   <zope:var name="standard_html_header"/>   <!--#var standard_html_header-->

Note that <!--#var foo--> is shorthand for <!--#var name="foo"-->

> 
>   <zope:var>index_html</zope:var>          <!--#var index_html-->

I'm not too wild about this one.
 
> For non-XMLists, notice the use of the slash ("/") character to close up
> empty elements. Also note how all parameters to a tag are wrapped in
> true attributes. Something like <var "foo"> simply isn't permitted.
> 
> Here's a sample of specifying a default namespace, so you that you use
> Zope tags without qualifying them with the "zope" namespace. Notice how
> this -- if it is to be done cleanly -- requires that you prefix HTML
> tags with the "html" namespace. I have not decided whether this is
> entirely necessary, since Zope will preprocess the DTML and in this
> case, would have to remote the "html:" prefix anyway.
> 
>   <in xmlns="http://www.zope.org/schema/1.0" expr="objectValues('DTML
> Document')">
>     <var>title_or_id</var><html:br>
>   </in>
> 
> Unfortunately, the idea that you can write something like <var
> standard_html_header> is rescinded by XML,

This isn't really a problem.  People will jet have to be more 
verbose.

> unless ASP-like "blocks" of
> code as Jules Allen proposes can be included. Given the current syntax I
> can't conceive of a way that this can be done elegantly -- the minute we
> step into "ASP-like"-ness, we're in the realm of "defining a new
> language". While Jules' example syntax would certainly work on a
> technical level, the question is, as much as we abhor the current SSI
> syntax, do we really want to become more like ASP?

No.

Jim

--
Jim Fulton           mailto:jim@digicool.com   Python Powered!        
Technical Director   (888) 344-4332            http://www.python.org  
Digital Creations    http://www.digicool.com   http://www.zope.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.