[Zope] - AW: [Zope] - XML-style DTML code
Carsten Oberscheid
co@daisybytes.su.uunet.de
Fri, 29 Jan 1999 18:00:29 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
>
> Paul Everitt writes:
> >
> >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:
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.
> >
> > <font size="<?ztml #var arg ?>">
> >
> >which *not* valid XML...is it? That is, can you have markup inside
> >markup?
>
> I don't believe so, but have CC'ed this to the XML-SIG where
> the real experts hang out. PIs have to be outside other markup; I
> suspect the XML way of handling your second case would be to define an
> entity:
>
> <font size="&arg;">
>
> This is unfortunate for the application of HTML templating, because it
> collides with the use of entities in HTML. It also makes things
> difficult because the entity would have to be declared at the
> beginning of the file in the DOCTYPE declaration. Making the
> templating identical to XML, while keeping it conveniently
> human-editable, may not be possible.
>
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".
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.
Regards
.co.
+------------------------------------------------------- daisy bytes! --------+
Carsten Oberscheid
co@daisybytes.su.uunet.de digital document processing
http://www.pweb.de/daisybytes.su electronic publishing
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.5.3i for non-commercial use <http://www.pgpi.com>
iQA/AwUBNrHbHowjR4jmR8/DEQKZpgCguMJhCDXh/sHIcP+uCeqz3PpF/PMAoP4U
btpPwlkRa66yQC9vahx904oU
=ibSb
-----END PGP SIGNATURE-----