[Zope] <% ... %> ?

Alexander Staubo alex@mop.no
Fri, 11 Jun 1999 23:27:29 +0200


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-->

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

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, 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?

--
Alexander Staubo             http://www.mop.no/~alex/
"`This must be Thursday,' said Arthur to himself, sinking low over
his beer, `I never could get the hang of Thursdays.'"

--Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
>-----Original Message-----
>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Paul
>Everitt
>Sent: 11. juni 1999 20:09
>To: 'Jules Allen'; zope@zope.org
>Subject: RE: [Zope] <% ... %> ?
>
>
>
>Jules wrote:
>> Has it been suggested that the SSI-type syntax of Zope isn't the most
>> readable thing in the world? Is this even the right list to
>> suggest this
>> heresy or should I strap on the asbestos underwear and wander
>> over to zopedev?
>
>I'll comment first on the multiline statement.  Let me reinforce the
>idea that The Zope Way is to separate presentation and logic.  While we
>should have some kind of object that better deals with logic, I don't
>think there will be much sympathy for creating something that
>looks like
>ASP or PHP.
>
>Let me limit the conversation back to your subject line: <% vs. <!--#
>
>The latter was originally chosen to be like the dominant syntax at the
>time (SSI) and to be "legal HTML".  I think the latter has proven to be
>total bunk, as almost no DTML Documents are valid (they get nearly
>everything from the fragments of standard header and footer).
>
>What are some reasons to consider changing from the SSI syntax?
>
>  o It's hideous, cumbersome, and everybody hates it
>
>  o No tools support editing it
>
>  o It isn't conformant with the direction of HTML
>
>  o Any others?
>
>Let's evaluate the situation in light of these.
>
>It's Hideous
>------------
>
>Yes.
>
>Tool Support
>------------
>
>The SSI syntax just happens to enjoy nearly zero support out there.
>Things like Netscape Composer, Dreamweaver, and Emacs HTML Mode just
>can't be convinced to handle it nicely.
>
>Does anyone view this issue as important?
>
>Future of HTML
>--------------
>
>What role does SSI play in the future of HTML?  Zero.  Of course,
>neither do any of the alternative syntaxes mentioned previously.
>
>Thus, I'd like to list some requirements for a future syntax:
>
>1) Within reach of "content managers".  I won't budge on this one.  I
>think XSL will have a role in Zope, but *NOT* as a DTML replacement.
>
>2) Reasonably close to DTML.  The current DTML accomplishes some level
>of functionality.  While some small amount might not be permitted in
>some change, or might be permitted in a clumsy way, there should be a
>reasonable match.
>
>3) Coherent with the HTML future.  We have a choice: invent a syntax
>and, one by one, support every web authoring tool.  Alternatively, we
>can stick to standards and wait for them to support it.
>
>Proposal
>--------
>
>_If_ these were the requirements, then I think a reasonable proposal is
>XHTML:
>
>  http://wdvl.com/Authoring/Languages/XML/XHTML/
>
>  http://www.w3.org/MarkUp/#future
>
>XHTML reworks HTML as an XML-compliant language.  Most imporantly, you
>can extend it with new namespaces (like Zope instructions) without
>breaking the DTD, as is the case with ColdFusion et al.
>
>Why?
>
>1) Alledgely it is the future of HTML.
>
>2) Becoming well-formed means the authors can be given hints before
>saving changes, and Zope can do smarter things with structured data on
>the server.
>
>Why Not?
>
>1) A number of differences with HTML might drive people off.
>
>2) It isn't here yet.
>
>3) Zope syntax might not be mappable into XML.
>
>At any rate, I'd love for someone in the Zope community to
>march off and
>take a look at this, then make a proposal for how things should be
>changed.  As always, patches are accepted. :^)
>
>--Paul
>
>Paul Everitt       Digital Creations
>paul@digicool.com  540.371.6909
>-----------------------------------------
>The Open Source Zope application server
>http://www.zope.org/
>-----------------------------------------
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://www.zope.org/mailman/listinfo/zope
>
>(For developer-specific issues, use the companion list,
>zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>