[Zope3-dev] IMPORTANT RFS: Through the Web Site Development
Steve Alexander
steve@cat-box.net
Wed, 15 Jan 2003 18:41:28 +0200
> Think about what is easier to understand for an non
> Programmer? Yes they begin with code like that!
>
> a) Hello <b><dtml-var name></b>, how are you?
>
> b) Hello <b tal:content="name">name</b>, how are you?
> (question that possibly arises: why is there two times
> something like a 'name' variable?)
>
> As you can see in the examples above the the DTML tags are
> separated from HTML tags. While programming DTML you can
> easily print "the source" and then mark the DTML parts
> with a marker.
>
> In ZPT you have to mix HTML with TAL-Expressions. If the
> page doesn't render correctly you have to fight with HTML
> and TAL in parallel.
You don't have to mix HTML with TAL expressions.
DTML: Hello <b><dtml-var name></b>, how are you?
ZPT: Hello <b><tal:tag replace="name"/></b>, how are you?
In ZPT, one of the constraints is to use valid XML. <dtml-var name> is
not valid xml, because "name" should be in quotes, and it should have an
attribute name. Actually, <dtml-var name> is a short-hand for <dtml-var
name="name">. So, without cheesy short-cuts:
DTML: Hello <b><dtml-var name="name"></b>, how are you?
ZPT: Hello <b><tal:tag replace="name"/></b>, how are you?
There's not so much difference now.
--
Steve Alexander