[Zope] DTML reformulated as XML (was RE: [Zope] <% ... %> ?)

Otto Hammersmith otto@ipass.net
Sat, 12 Jun 1999 01:23:59 -0400


Paul Everitt wrote on 6/11/99 5:54 pm:

>
>Otto Hammersmith wrote:
>> I'll start by saying, this is 
>*absolutely* the right thing 
>to do.  I've
>
>Hmm, I don't get that 
>reaction often these days. 
>:^)
>
>> been mulling over this 
>exact idea, but haven't had 
>the time to post  something 
>to the list. (Not that I've 
>been playing with Zope 
>overly  long.)
>
>I'd like to make sure 
>everyone agrees on the 
>goals, though.  Just like the 
>idea of "Python Methods" 
>aka script objects, I think 
>everyone wants  change, but 
>perhaps for different 
>reasons.
> 
>> I do want to point one thing 
>out, though: adding 
>namespaces does break  the 
>DTD.  Currently there is no 
>way to validate a document 
>that uses
>
>Hmm, didn't realize that.
>
>> namespaces.  This will be 
>fixed, eventually.  Until 
>then, you just have  to live 
>with well-formed but not 
>valid documents.
>> (Well, you can define a 
>special DTD that defines the 
>namespace prefix as  well, 
>but then that defeats the 
>ability to change the 
>namespace prefix.)
>
>Right.
> 
>> > Why?
>> >
>> > 1) Alledgely it is the 
>future of HTML.
>> >
>> > 2) Becoming well-formed 
>means the authors can be 
>given hints before
>> > saving changes, and 
>Zope can do smarter things 
>with structured data on
>> > the server.
>> >
>> > Why Not?
>> >
>> > 1) A number of 
>differences with HTML 
>might drive people off.
>> 
>> Purely syntactic: <br> 
>becomes <br/> and you 
>can't leave out end tags
>> (</p>) it's not so bad.  
>Well, okay, I imagine there 
>will be a lot of  griping over 
>the decision of enforce 
>lowercase element names. :)
>
>The bit about:
>
><select name="foo">
><option selected>Splat
></select>
>
>...not working, as attributes 
>(selected) can't be minimed 
>is, erm, weird.
> 
>> > 2) It isn't here yet.
>> 
>> Simple transformation 
>makes XHTML into HTML, 
>again for old clients.  
>Probably so simple, it's not 
>worth involving XSL.
>
>Hopefully there wouldn't be 
>much transformation, right?  
>That is, people could just 
>write stuff that was 
>readable by clients.
> 
>> > 3) Zope syntax might 
>not be mappable into XML.
>> 
>> Close, but not quite.  I'm 
>sure it's possible to create an 
>XML syntax  that has all the 
>functionality of DTML... 
>however, it might very well  
>end up being an ugly 
>unwieldy syntax.
>
>Here's one thing in DTML 
>that would be awfully 
>obscure in XML:
>
><a href="<!--#var 
>BASE1-->">
>
>That is, putting a tag inside 
>an attribute.  Chris Petrilli 
>and Jim talked about this 
>today, perhaps as as entity 
>references.
> 
>> > At any rate, I'd love for 
>someone in the Zope 
>community to march off and
>> > take a look at this, then 
>make a proposal for how 
>things should be
>> > changed.  As always, 
>patches are accepted. :^)
>> 
>> I've been meaning to do 
>something like this.  I might 
>just spend some  time 
>thinking about it this 
>weekend.  Any actual coding 
>probably won't  happen, 
>though. :)
>
>Understood.  If you produced 
>a clear definition of the 
>goals, some samples for the 
>syntax, and a list of things 
>that are good and bad about 
>it, then that would be a 
>major win.
> 
>> The simple stuff is easy:
>> 
>> <?xml version='1.0'?>
>> <xdtml:xdtml 
>xmlns:xdtml="http://www.z
>ope.org/xdtml"  
>xmlns="http://www.w3.org/
>TR/xhtml1">
>> 
>> <xdtml:var 
>name='standard_html_head
>er'/>
>> <h1><xdtml:var 
>name='title'/></h1>
>> <p>This is a 
>paragraph.</p>
>> 
>> <xdtml:if expr='age &gt; 
>18'>
>> <p>Text not everyone 
>should read.</p>
>> </xdtml:if>
>> 
>> <xdtml:var 
>name='standard_html_foote
>r'/>
>> 
>> </xtml:xdtml>
>
>I'd love to do a straw vote 
>from the "I hate SSI" crowd: 
>is the above better?
> 
>> The if gets really strange 
>when you start adding 'elif' 
>and 'else'  clauses.  I'll have to 
>think about that one.
>> 
>> The containing xdtml 
>element is just there as a 
>place to hang the  
>namespace declarations off 
>of.  Also, it's there to make 
>the DTML object  a 
>full-fledged self-contained 
>XML document, needed to 
>make any kind of  editor 
>useful.
>
>Precisely.  It comes from the 
>namespace declaration at 
>the top.
> 
>One more thing to muse 
>over is whether other things 
>from XML land should 
>surface.
>
>For instance, I've long 
>wondered if the ubiquitous 
>var tag should be broken 
>apart.  People ask: why can't 
>yo
>
>*******************
>******
>This e-mail has been 
>truncated. The entire e-mail 
>is available in your E-Mail 
>application.
> 


			-Otto.