[Zope] Emacs and dtml-mode +/-

Alastair Burt burt@dfki.de
11 Sep 2000 13:02:39 +0200


"Nestor A. Diaz L." <nestor@engendro.com> writes:

> I have installed the dtml-mode that provided
> http://www.zope.org/Members/alburt under Debian potato, emacs20 and
> psgml it work so nice but i have a little question, and i don't know if it
> is possible to resolve, consider the following html code:
> 
> <!-- -*- dtml -*- -->
> <html>
>   <head>
>     <title></title>
>   </head>
>   <body>
>     <select>
>       <!-- one of (OPTION OPTGROUP) -->
>       <dtml-with>
> 	<!-- I can't insert tag <option> here -->
>       </dtml-with>
> 
>     </select>
>     <dtml-var>
>   </body>
> </html>
> 
> Check out that i can not insert a <option> tag inside the <dtml-with> tag,
> ok what i want to know (if there is any dtd guru here) is: there is
> posible to define a rule in this dtd to see that the <dtml-with> is inside
> a select and it shows as a correct element the <option> tag?
> Another question?

Yes, although I wrote the hacked DTD for the mode, I am no DTD guru.
Maybe, there is a way to do it with a better DTD.

There was once a rumour that there was going to be an XML compliant
specification of DTML.  This would presumably make the problem go away.  It
is a long time since I heard any more about this.  Does anyone know what
became of the idea?
 
> Thats anybody know about a "html indenter" i mean something like the
> program indent avaialable under Linux ? for html? i know emacs indent but
> i have to press the <tab> on each line, or i'm missing some macro?
> 
> It would be nice that this program can run under zope to show the html
> code generated beautifully for debug reasons, dont you think so? and
> desactivate it under a production environment.

I use HTML Tidy from Dave Ragget [1].  I have, of course, got Emacs code to
tidy up and indent HTML code in the buffer currently being edited.  Ii is
only a few lines but I will make it available if there is interest.

I also had wondered whether it would be worthwhile binding HTML Tidy into
Zope. The way dynamic web sites generate HTML code out of bits, often
leaves the resulting HTML code illegible and, not incidentally,
syntactically incorrect.

--- Alastair

Footnotes: 
[1]  http://www.w3.org/People/Raggett/tidy/