[Zope] DTML reformulated as XML (was RE: [Zope] <% ... %> ?)
Jules Allen
zope@jules.com
Sat, 12 Jun 1999 09:02:09 -0400
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 > 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