[Zope] DTML reformulated as XML (was RE: [Zope] <% ... %> ?)

Michel Pelletier michel@digicool.com
Sat, 12 Jun 1999 11:21:05 -0400


Jim introduced a new experimental DTML syntax this week:

http://www.zope.org/pipermail/zope-checkins/1999-June/000667.html

(BTW, for those of you who don't know, the zope-checkins mail list
provides a checkin by checkin view of the evolution of Zope)

This syntax is handy for emacs HTML mode, which never gets the SSI
syntax right.  I'm going to start playing with it.  I understand the
pain of those who want to use their favorite web authoring tool to write
DTML, but being a
you'll-see-me-using-a-different-editor-when-my-cold-dead-hand-double-cli
cks-on-its-icon Emacs user, I have little sympathy. ;) (Emacs does it
all!)

-Michel

> -----Original Message-----
> From: Jules Allen [mailto:zope@jules.com]
> Sent: Saturday, June 12, 1999 9:02 AM
> To: Paul Everitt
> Cc: zope@zope.org
> Subject: Re: [Zope] DTML reformulated as XML (was RE: [Zope] <% ... %>
> ?)
> 
> 
> On Sat, Jun 12, 1999 at 05:51:27AM -0400, Paul Everitt wrote:
> |I'd like to make sure everyone agrees on the goals, though.  
> Just like
> |the idea of "Python Methods" aka script objects, I think 
> everyone wants
> |a change, but perhaps for different reasons.
> 
> I've been a long time Python fan and only recently have I got 
> to use it
> in order to help pay my mortgage. Of course I came to it via Perl and
> don't have the same bitter-sweet relationship with it as I do with The
> Camel.
> 
> I can come back to something I wrote months before and instantly know
> what the code does even if I can't remember what I was thinking. It
> could be that I'm just a sloppy programmer any Python forces me to be
> more organized. Which is good.
> 
> But hey, I don't think I need to sell you on Python. :-)
> 
> Zope got my teeth itching as I suppose I came to it expecting 
> and embedded
> Python/HTML love fest which isn't the case. DTML can be Python-ish
> sometimes but not at others. Unlearn, as Yoda might say.
> 
> I'm having a hard time with DTML as I'm still not sure what I can do
> with it. Getting over the i-don't-think-in-perl-php-cold-fusion-or-asp
> hump is part of the process of course. All my personal 
> breakthroughs in
> programming come from reading other people's code and that's 
> really what
> prompted me to drop the original email.
> 
> It is *hard* to read DTML! Partly because my eyes aren't used 
> to it and
> partly because my editors (vim and Homesite) don't know about DTML. In
> an earlier email either you or somebody else made a comment 
> about having
> to write a syntax highlighter for each editor and what a drag it would
> be. Sure, any decent html editor will deal with <!-- --> correctly but
> it's a bigger drag for the newbie who doesn't know the syntax of the
> language.
> 
> In a round-about way, I'm freely admitting to being a wickedly
> lazy individual. I certainly don't want GUI tools to build DTML (GUI
> programming tools are almost as evil as the seeminly humble mouse, but
> that's another story) but I do want either an editor that will help me
> with the drudge work or a simpler way to write the language. 
> Or even --
> yum! -- both.
> 
> One of the sexiest PHP features is the syntax highlighter. If a site
> allows it. It's not a very whizzy example but take a look at 
> 
	http://www.php.net/docs.php3

and then take a look at

	http://www.php.net/source.php3?page_url=/docs.php3

That takes newbie "look, how did they do that?" questions to a "look
how they did that!" level. Nice.

Is this already in Zope? And if it is, why couldn't I find it? (Hint:
because you're a wickedly lazy individual, Jules)

|> The simple stuff is easy:
|> 
|> <?xml version='1.0'?>
|> <xdtml:xdtml xmlns:xdtml="http://www.zope.org/xdtml"
|> xmlns="http://www.w3.org/TR/xhtml1">
|> 
|> <xdtml:var name='standard_html_header'/>
|> <h1><xdtml:var name='title'/></h1>
|> <p>This is a paragraph.</p>
|> 
|> <xdtml:if expr='age &gt; 18'>
|> <p>Text not everyone should read.</p>
|> </xdtml:if>
|> 
|> <xdtml:var name='standard_html_footer'/>
|> 
|> </xtml:xdtml>
|
|I'd love to do a straw vote from the "I hate SSI" crowd: is the above
|better?

Tons better. An editor like HomeSite could be configured to handle this
nicely. And it doesn't look like line noise :-)

Cheers,
Jules


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