Re: [Zope] Re: Is DTML a bastardized form of XML, or valid XML?

2000-06-23 Thread Joe Pallas

I'm pretty sure "new syntax" DTML is not actually valid XML, but it 
doesn't really matter:  it's a bad idea either way.  The new syntax 
is a misguided attempt to mix the base and meta levels, which can 
only result in confusion.

DTML is not markup, it is a macro language for generating markup.  As 
such, it will not always be possible to coerce it into a form that 
meets the syntax rules of the base language.  But meeting those 
rules, and consequently being able to use XML editors, is the only 
real justification for the new syntax.

h1 !--#if "fervor  2"--class="hot"!--#/if--
How do I do this in "new" DTML?
/h1

h1 dtml-if "fervor  2"class="hot"/dtml-if
This isn't valid XML (bad attribute).
/h1

dtml-if expr="fervor  2"
h1 class="hot"
dtml-else
h1
/dtml-if
This isn't valid XML, either (bad nesting).
/h1

dtml-if expr="fervor  2"
h1 class="hot"
This is very clumsy and does not scale.
/h1
dtml-else
h1
...but I think it is valid XML.
/h1
/dtml-if

Also, XML requires all attributes to be quoted, so forget about using 
the implicit name/expr distinction with your shiny new XML editor.

The new syntax doesn't satisfy the arguments that were given to 
support it, and it decreases the readability and maintainability of 
DTML code that uses it by making it hard to distinguish DTML 
directives from markup.  I avoid it, and I don't recommend it to 
others.

joe

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] Re: Is DTML a bastardized form of XML, or valid XML?

2000-06-23 Thread Paul Everitt


There was tremendous discussion on the mailing list around the time of
the introduction of the new syntax.  As Jim made clear, the goals of the
new syntax did _not_ include XML compliance.  Instead, the goals were:

a. Get rid of the old syntax.  The SSI style was universally ridiculed
and requires typing of hard-to-reach characters.

b. Make it possible for some HTML editors that can extend their tag
database to recognize DTML tags.

At the time of the introduction, XML editors were not widely adopted.
That still hasn't changed.

Hope this correction helps.

--Paul

 -Original Message-
 From: Joe Pallas [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 23, 2000 8:39 AM
 To: Martijn Pieters; Hung Jung Lu
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [Zope] Re: Is DTML a bastardized form of XML, or 
 valid XML?
 
 
 I'm pretty sure "new syntax" DTML is not actually valid XML, but it 
 doesn't really matter:  it's a bad idea either way.  The new syntax 
 is a misguided attempt to mix the base and meta levels, which can 
 only result in confusion.
 
 DTML is not markup, it is a macro language for generating markup.  As 
 such, it will not always be possible to coerce it into a form that 
 meets the syntax rules of the base language.  But meeting those 
 rules, and consequently being able to use XML editors, is the only 
 real justification for the new syntax.
 
 h1 !--#if "fervor  2"--class="hot"!--#/if--
 How do I do this in "new" DTML?
 /h1
 
 h1 dtml-if "fervor  2"class="hot"/dtml-if
 This isn't valid XML (bad attribute).
 /h1
 
 dtml-if expr="fervor  2"
 h1 class="hot"
 dtml-else
 h1
 /dtml-if
 This isn't valid XML, either (bad nesting).
 /h1
 
 dtml-if expr="fervor  2"
 h1 class="hot"
 This is very clumsy and does not scale.
 /h1
 dtml-else
 h1
 ...but I think it is valid XML.
 /h1
 /dtml-if
 
 Also, XML requires all attributes to be quoted, so forget about using 
 the implicit name/expr distinction with your shiny new XML editor.
 
 The new syntax doesn't satisfy the arguments that were given to 
 support it, and it decreases the readability and maintainability of 
 DTML code that uses it by making it hard to distinguish DTML 
 directives from markup.  I avoid it, and I don't recommend it to 
 others.
 
 joe
 

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Re: Is DTML a bastardized form of XML, or valid XML?

2000-06-23 Thread Martijn Pieters

On Fri, Jun 23, 2000 at 08:39:01AM -0700, Joe Pallas wrote:
 I'm pretty sure "new syntax" DTML is not actually valid XML, but it 
 doesn't really matter:  it's a bad idea either way.  The new syntax 
 is a misguided attempt to mix the base and meta levels, which can 
 only result in confusion.
 
 DTML is not markup, it is a macro language for generating markup.  As 
 such, it will not always be possible to coerce it into a form that 
 meets the syntax rules of the base language.  But meeting those 
 rules, and consequently being able to use XML editors, is the only 
 real justification for the new syntax.
 
 h1 !--#if "fervor  2"--class="hot"!--#/if--
 How do I do this in "new" DTML?
 /h1
 
 h1 dtml-if "fervor  2"class="hot"/dtml-if
 This isn't valid XML (bad attribute).
 /h1
 
 dtml-if expr="fervor  2"
 h1 class="hot"
 dtml-else
 h1
 /dtml-if
 This isn't valid XML, either (bad nesting).
 /h1
 
 dtml-if expr="fervor  2"
 h1 class="hot"
 This is very clumsy and does not scale.
 /h1
 dtml-else
 h1
 ...but I think it is valid XML.
 /h1
 /dtml-if
 
 Also, XML requires all attributes to be quoted, so forget about using 
 the implicit name/expr distinction with your shiny new XML editor.
 
 The new syntax doesn't satisfy the arguments that were given to 
 support it, and it decreases the readability and maintainability of 
 DTML code that uses it by making it hard to distinguish DTML 
 directives from markup.  I avoid it, and I don't recommend it to 
 others.

The reason to introduce the now-not-so-new-anymore syntax was to make it more
pallatable to _HTML_ editors, not XML editors. To this end also the DTML
entity syntax was introduced, so you could easily embed variables and object
calls (whith various formatting options) inside tags.

With the enitity reference we can get closer to XML conformance. The above
could also be formatted as:

  dtml-let fervor_class="_.test(fervor  2, 'class=\x22hot\x22', '')"
h1 dtml_-fervor_class;
  This is, as far as I can see, valid XML, if maybe somewhat convoluted.
/h1
  /dtml-let

The let tag combined with the _.test() method will assign a value of
'class="hot"' or '' to fervor_class, which is then inserted into the generated
text without any formatting.

But, again, the DTML syntax wasn't designed for this. It doesn't do
namespaces. The dtml-else tag in a dtml-if/dtml-if isn't technically an
empty tag, yet XML would dictate it is, and also require a / at the end. Etc.

It was purely designed to be tolerated by an HTML editor, that doesn't care
about bad nesting or what an empty tag should look like. We just tried to make
a WYSIWYG HTML editor a bit more useful for HTML with DTML in it.

-- 
Martijn Pieters
| Software Engineermailto:[EMAIL PROTECTED]
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
|   The Open Source Web Application Server
-

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Re: Is DTML a bastardized form of XML, or valid XML?

2000-06-22 Thread Martijn Pieters

On Thu, Jun 22, 2000 at 05:45:58PM -0700, Hung Jung Lu wrote:
 The rest should be handled through a good GUI (Graphical User Interface),
 with fancy stuff like collapsable panel items. I hope Digicool is doing
 something like this with their Mozilla project.

This kind of feature may indeed become part of Zope Studio _one day_. I first
of all want Zope Studio to be a working product.

For a first version, the goal of Zope Studio to provide a GUI alternative for
the current management interface, but with the same basic functionality. For
DTML editing this means that it will provide no more than basic text editing.

I am in the process of clarifying all this right now, before we do any more
development. The Zope Studio ZWiki will, over the coming days, contain much
more information on what Zope Studio is about.

-- 
Martijn Pieters
| Software Engineermailto:[EMAIL PROTECTED]
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
|   The Open Source Web Application Server
-

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )