[Zope] - XML-style DTML code

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


On Fri, Jan 29, 1999 at 01:49:08PM -0800, Amos Latteier wrote:
> 
> Getting this right is an important project. I don't know enough about XML
> and XML editors to know what's necessary for them to edit DTML, but it
> would be great if they could. Otherwise, allowing more HTML editors to edit
> DTML would be the next best thing.

Well, incremental steps, grasshopper :-) My first goal was to simply
make it work better in HTML editors, many of which I've seen (at least I
think I've seen) support user-defined tags like this... BBedit certainly
does, and so does Cyberstudio.  Later comes delving into XSL and whether
it can be made to work as another methodology.

> Despite how sneaky and cool it is, from an esthetic point of view, I really
> dislike Carsten's entity defining hack. Maybe if entities could be used
> more generally in DTML, then this wouldn't seem so weird... Maybe there
> could be some general way to access variables in the template's name space
> using entities...

I have to agree here, it's a neat idea, but, after a lot of thought, I'm
affraid it'll just confuse too many people, and also perhaps lead to
problems down the road with further XML integration... 

> Anyway, I don't have the answers, but I want to reiterate my support for
> Chris's and everyone else's efforts. Thanks!
> 

Well, thanks, I've uploaded a tweeked patch to the same location as
before, which removes the # from the syntax... I think this really looks
a lot cleaner... you can now just do:

	<?ztml var arg ?>

I'm going to look into the SGML mode in Emacs see if I can teach it some
more, so that it can look inside PI elements.  Next on my step of items
to blow up so as to make everyone's life more difficult is to get the
following working, as proposed (slightly modified by me):

	<?ztml store var arg ?>

What this does is shove the value of 'var arg' (or <!--#var arg--> in
the existing dialect) into a register (that's only good for a single
document session, i.e. not really global, nor in any way persistent),
which you can then insert as you wish:

	<A HREF="&ztml;">Go here.</A>

This seems to be the best way in my mind to fit into the XML world with
least breakage, and least problem.  NOW, that's not sayin that the
existinting method:

	<A HREF="<?ztml var arg?>">Go here.</A>

Will no longer work, it's just not the option you should use for maximum
behavioural correctness. :-)  Perhaps it can be deprecated at some point
in the future (Zope 2?)...

Now having blathered on and on and on, let me state I'm not working for
DC, I'm not that cool :-) I'm just playing with ideas, and trying to
clean up some things that bug me personally... doesn't mean it will be
officially blessed in the end.

One final note, looking at the DTML parser (which may require some heavy
changes for the the &ztml; trick, since currently I don't think it
handles such things, just <> thingies :-)  ... BUT there's some cruft
left in there that uses the old %() form of DTML... is this something we
can remove?  I'm curious, I don't know how much ofit there is, but I'm
wondering if there's really anyone USING it?! :-) I understand it might
be more natural for Python people, but... I fear that with the new 
syntax I'm proposing <?ztml ...?> that it will be too many options, and
some users heads might explode... something I personally don't want to
recover.  

Just my ramblings for the evening!

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