[Zope] - AW: [Zope] - XML-style DTML code

Christopher G. Petrilli petrilli@amber.org
Fri, 29 Jan 1999 12:33:48 -0500


I've moved this BACK to the Zope list, this is getting tooooo
XML-oriented for the problem I'm trying to fix :-)

On Fri, Jan 29, 1999 at 06:00:29PM +0100, Carsten Oberscheid wrote:
> > >
> > >  <font size="<!--#var font_size-->">
> > >
> > >which is legal, would become:
> 
> Sorry, I think this ain't legal, too. It's ok with sgml (at least nsgmls 
> doesn't complain), but the XML specs say you can't use "<" inside attribute 
> values at all.

No this isn't legal, I know that much.  I'm not really sure that there's
a "quick" solution to creating a fully well-formed XML solution... but
read more below.

> What about this:
> 
>    <?ztml store("var arg") ?><font size="&ztml;">
> 
> where &ztml; is a dummy entity declared once in the DTD. This should be valid 
> XML.
> The DTML engine then interprets the PI as "I store this string as a DTML 
> command, then next time I encounter &ztml; I replace it with the results of the 
> DTML command".

Hmm, I like this!  It fixes the well-formed XML side, without creating a
huge mish-mash of new syntax.  &ztml; should always be null util ti's
first initialized.... this would let you do neat things I think!  

> I admit that this is less editable/readable than the current DTML syntax, but 
> it's quite close, especially if the "store" PI is kept close to the &ztml; 
> "placeholder". For the "simple" case of DTML commands within character data 
> Chris' proposal still works:
> 
>    <P> ...plain text ... <?ztml "var arg" ?>  ... </P>
> 
> without the "cmd" assignment can be "executed" and replaced immediately without 
> the entity stunt, and it is valid XML.

Bless you for such a well formed option!  What does everyone else think
of gthis?  It's a bit more "shoe-horning" into the parser, but perhaps
... I don't know it shouldn't that hard <handwave 1.3> :-)

Chris
-- 
| Christopher Petrilli
| petrilli@amber.org