cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Stocker <chr...@bitflux.ch>
Subject Re: Templating: experiments with Conal's html-to-xslt transform
Date Fri, 10 Dec 2004 12:39:28 GMT


On 10.12.2004 11:27 Uhr, Bertrand Delacretaz wrote:
> (ccing users@ as I'm sure many subscribers there could contribute to 
> this experiment as well, please discuss on dev@)
> 
> I've been playing [1] with Conal Tuohy's transform [2], to generate XSLT 
> transforms based on simple attribute-based templates (HTML in this case, 
> could be whatever) and I like it very much.
> 
> Converting attribute-based templates to XSLT instead of processing them 
> directly is fairly easy to implement, easy to use for the template 
> writer yet powerful by giving access, when needed, to all XSLT 
> constructs. And the syntax of attributes like for-each or 
> apply-templates *is* XSLT, so Bob can ask Alice for help when needed ([3]).
> 
> There's more info, including source code, on the wiki [1]. Feel free to 
> use this page as a poor man's source code control system for improving 
> this, if people like it we might want to include this our distribution?
> 
> Compared to Conal's version, the current version allows "element 
> templates" to be defined in the HTML template, they are similar to XSLT 
> templates but much easier to write. I think this adds a lot of power 
> while allowing the template to remain concise and modular, and "fairly" 
> editable in visual tools. There has to be a compromise somewhere I 
> think, converting XML data to HTML or another format *is* programming at 
> some stage, the "100% visual" paradigm does not work for this in today's 
> world IMHO.
> 
> Comments/opinions/enhancements/flames are welcome (well, maybe not 
> flames but if you think this sucks I'm all ears ;-)

As I mentioned before (to one of stefano's posts), we did something 
similar, but with the TAL syntax. We convert that to XSLT with XSLT and 
then do the actual transformation with XSLT. It's the same idea as 
yours. I like the approach, even though it's not complete yet (our 
implementation) and we could certainly add some of your ideas.

Here's the XSLT

http://svn.bitflux.ch/repos/public/popoon/trunk/components/transformers/xsltal/tal2xslt.xsl
and here's simplel template
http://svn.bitflux.ch/repos/public/bxcmsdemo/themes/bxcms/template.tal

I don't say, our approach is better than yours, I didn't build an 
opinion on that. But maybe we could join efforts in it. As it's a pure 
XSLT implementation, the programming language behind doesn't really matter.

chregu

-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  chregu@bitflux.ch  |  gnupg-keyid 0x5CE1DECB

Mime
View raw message