[Zope] - XML-style DTML code

Jeffrey Shell Jeffrey@digicool.com
Fri, 29 Jan 1999 09:44:31 -0500


> Chris wrote:
> > 	<?ztml #var arg ?>
> 
> Ahh, tis nuthin better than seeing a patch accompany a proposal :^)
> 
> Here's my main beef with this.  The ostensible goal of the 
> XML syntax is
> to make it parse-able by new tools.  Unfortunately, a valid use of the
> current syntax:
> 
>   <font size="<!--#var font_size-->">
> 
> which is legal, would become:

I've yet to see _ANY_ tool, no matter how smart, correctly figure out
the above.  Even code like the following:

<SELECT NAME="foo">
 <!--#in brat-->
  <OPTION><!--#var sequence-item--></OPTION>
 <!--#/in-->
</SELECT>

gets munged in Cyberstudio by moving the <!--#in--> tags outside of the
<SELECT> tags.  Even "we'll never munge-up-yr-code" Dreamweaver has
presented trouble.

A problem is that by using HTML Comment syntax, it's actually harder to
teach HTML editors to handle DTML because most of them already have code
to handle comments (even the luxurious Alpha text editor has a lot of
quirks) as comments, not processing directives, and it's harder to
extend them to handle our special comment syntax.  But training Alpha
and other smarter editors to recognize something a bit more unique like
<?ztml ?> would be easier.  Or even just to recognize the <? ?>
processing directives.  (Dreamweaver already recognizes ASP's <% %>
syntax.  It doesn't do anything magical with it like attempting to
render it, but it does recognize it).

>   <font size="<?ztml #var arg ?>">
> 
> which *not* valid XML...is it?  That is, can you have markup inside
> markup?

I don't think this is ever valid.  Using HTML to generate HTML will
always cause problems with editors, I'm sure.

ColdFusion gets around this problem a little bit by (a) using normal
tags <cfinput> <cfquery>, etc..., and (b) using a shortcut for 'var' -
##, like

<font size="#arg#">

i like the <?ztml proposal.  PHP has something similar.  I'd prefer
something like the following though:

<?ztml-tag (like <?ztml-var ?>, <?ztml-in?>, etc...)

although that Z key is not something i'm used to reaching for...  maybe
keep it dtml instead?

<?dtml-if signature?>
 <?dtml-var signature fmt=structured-text?>
<?/dtml-if?>

:)