DTML singleton tags
Hi, list we are generating DTML code from XML via a XSLT transformation (using Daniel Veillard's wonderful libxml2). Problem is, that DTML has a couple of `singleton' tags, most prominently <dtml-var ...>. This is not very XML friendly, and as we want to produce DTML, we have to embed DTML code in the XSLT stylesheet. To make things easier, I just modified Zope (don't kill me ;) to accept a trailing slash in tags, as in <dtml-var .../>. Since the parser (in $ZOPEDIR/DocumentTemplate/DT_HTML.py) doesn't know about the tag names, I chose the most lazy variant and accept a trailing slash in *any* tag (with possible whitespace between `/' and `>'). I'd like to make the patch available if there is any interest. I'd be willing to modify my solution if this makes the patch more acceptable. I see three possibilities: (1) Lazy. Any (non-closing) tag accepts (and ignores) a trailing slash (that's what I've right now, and I'll stick to it if it stays my private solution). (2) Sloppy. HTML-ish. Accept a trailing slash for singletons. Would be my favourite -- but would only be worth the effort if it gets integrated back, I think. (3) Picky. XHTML-ish. Enforce trailing slash in singletons. Would break existing DTML code, thus I'd rule this out. What do you think? Regards -- tomas
<tomas@fabula.de> wrote:
we are generating DTML code from XML via a XSLT transformation (using Daniel Veillard's wonderful libxml2). Problem is, that DTML has a couple of `singleton' tags, most prominently <dtml-var ...>.
This is not very XML friendly, and as we want to produce DTML, we have to embed DTML code in the XSLT stylesheet.
To make things easier, I just modified Zope (don't kill me ;) to accept a trailing slash in tags, as in <dtml-var .../>.
Since the parser (in $ZOPEDIR/DocumentTemplate/DT_HTML.py) doesn't know about the tag names, I chose the most lazy variant and accept a trailing slash in *any* tag (with possible whitespace between `/' and `>').
I'd like to make the patch available if there is any interest. I'd be willing to modify my solution if this makes the patch more acceptable. I see three possibilities:
(1) Lazy. Any (non-closing) tag accepts (and ignores) a trailing slash (that's what I've right now, and I'll stick to it if it stays my private solution).
(2) Sloppy. HTML-ish. Accept a trailing slash for singletons. Would be my favourite -- but would only be worth the effort if it gets integrated back, I think.
Why not. But can't you generate ZPT instead? ZPT is XML-compliant. Florent
(3) Picky. XHTML-ish. Enforce trailing slash in singletons. Would break existing DTML code, thus I'd rule this out. -- Florent Guillaume, Nuxeo (Paris, France) +33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com
tomas@fabula.de wrote:
Hi, list
we are generating DTML code from XML via a XSLT transformation (using Daniel Veillard's wonderful libxml2).
Why? Given your need for XML, I'd strongly recommend switching to ZPT. Among their many advantages was a requirement to be XML-ish from the start. cheers, Chris
On Tue, Sep 03, 2002 at 10:17:08AM +0100, Chris Withers wrote:
tomas@fabula.de wrote:
Hi, list
we are generating DTML code from XML via a XSLT transformation (using Daniel Veillard's wonderful libxml2).
Why? Given your need for XML, I'd strongly recommend switching to ZPT.
Among their many advantages was a requirement to be XML-ish from the start.
This is definitely the more elegant solution in the long term. As I pointed out in my other posting, we have people in the project using DTML and therefore want to switch gently. If you try to snatch the tool out of the hands of a working handyman, (s)he might try to hurt you ;-) For the meantime, this solution works for us. I just wanted to know whether there are folks out there in need of something similar. Thanks -- tomas
tomas@fabula.de wrote:
If you try to snatch the tool out of the hands of a working handyman, (s)he might try to hurt you ;-)
If the tool happens to be a loaded gun pointed at their foot, I think the risk of them hurting you is worth taking ;-) cheers, Chris
participants (3)
-
Chris Withers -
Florent Guillaume -
tomas@fabula.de