[Zope] - Re: - Zope, DTML and XML

Paul Prescod paul@prescod.net
Tue, 15 Dec 1998 12:41:54 -0600


Jim Fulton wrote:
> 
> > Right, but DTML code is not valid XML code. It can't be edited in an XML
> > editor, stored in an XML repository, routed through XML-based workflow,
> > etc. etc.
> 
> Is that important?  Python isn't valid XML code either, but it's
> still useful.  

Sure, but read my second sentence above. 

According to the Zope documentation, one of the goals of DTML is to allow
a separation of responsibilities between graphic designers and
programmers. Don't we expect graphic designers to be editing their stuff
in XML editors in the future? If so, "DTXML" must be at least well-formed
XML.

> I think it would be useful if there was an XML-compatible
> syntax for DTML, but I don't see that having much to do with XSL.

Maybe not. I started out trying to answer the question that was posed to
me at SPAM 7 about how DTML and XML should work together. Perhaps I
misunderstood the question or Paul E. didn't know that you already had the
answer.

> The difference between XSL and DTML run far deeper than syntax.

Agreed. All I'm saying is that you need a syntax and it makes sense to
as-far-as-possible reuse syntax. For instance, your current syntax for
embedding template instructions in attributes is <el a="<!--foo-->">. That
isn't valid XML. The XSL syntax is <el a="{foo}"> Not surprisingly, that
IS valid XML.

> > Right. But the same holds for DTML. You don't write DTML to generate an
> > IMG tag for a specific picture.
> 
> Often you do.  Or at least, you typically start out with a relatively
> specific thing.  For example, an in tag is applied to a specific collection
> or to the results of a specific call (e.g. a database query).  Then,
> code is applied to elements within the collection.

Actually, XSL has a simple concept called xsl:for-each. It may or may not
be worth unifying at that level, however. I was mostly thinking of the
syntax for:

 * static elements and attributes
 * evaluated attribute values
 * evaluated text creation
 * evaluated element type names
 * evaluated attribute name/value pairs

Admittedly, XSL doesn't have a publicly available syntax for the last two
yet.

> XSL is rule-based.  You don't say "interate over this and within this
> iteration output X and then output Y".  

You can, if it makes sense. I'm not 100% sure, in fact, if you really need
the multiple-rule feature, or if you could do everything top down with
iterators and conditionals. But the multi-rule way is certainly more
convenient.

> In XSL (speaking as someone
> pretty ignorant of XSL ;) you say things like "if you see a Foo, convert
> it to a bar ....".  It's like the difference between Python and Prolog

That's true, but you are talking about flow of control and not the
template syntax. I'm not suggesting a change in DTML flow of control. For
good reasons it is function-call controlled.

> I have a syntax in mind.  But that seems to me to be beside the point.
> This discussion isn't really about syntax issues, is it?

Actually, to me it is. I think that's why we're talking past each other. I
won't go into much detail responding to the rest of your mail, because I'm
really not asking for DTML to become an XSL implementation. I'm just
saying that where ideas are shared, the syntax can be shared. Thus my list
above.

If enough syntax can be shared that DTML becomes merely a non-standard
variant of XSL, then great. If we can even think of the entire document
base as an XML document, that would be even cooler. I'm not willing to
propose either of those yet, however. Right now I'm just pointing out that
XSL has a reasonable syntax for some things that "DTXML" needs to do.

 Paul Prescod  - ISOGEN Consulting Engineer speaking for only himself
 http://itrc.uwaterloo.ca/~papresco

"Sports utility vehicles are gated communities on wheels" - Anon