cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conal Tuohy" <Conal.Tu...@vuw.ac.nz>
Subject RE: [RT] Attribute Driven Templates
Date Tue, 07 Dec 2004 23:33:31 GMT
> Le 7 déc. 04, à 18:54, Sylvain Wallez a écrit :
> > ...(hearing Stefano coming behind me, ready to shout "FS!!!" in my 
> > ears...)
> 
> Nahh...his detector exploded yesterday, don't worry.
> 
> > ...Now going back to the annotated-HTML-to-XSL compiler that we 
> > (Anyware) wrote many years ago, it allows to mix both syntax, as 
> > attributes are simply translated to their XSLT equivalent, and you 
> > therefore can write plain XSLT in the HTML file (aargh! I 
> hear Stefano 
> > coming!)
> >
> > A similar approach could be used for the template language with a 
> > single engine, by simply converting on the fly 
> > directives-as-attributes to directives-as-elements...

Bertrand Delacretaz:

> Interesting - do you envision using XSLT for this conversion? 
> Or doing 
> it in java code?

At NZETC we have used a similar system to what Sylvain describes: We use XSLT to convert attribute-driven
HTML to XSLT. The XSLT is attached (3.5kb).

It performs text substitution both in attribute values e.g. <p class="{foo/bar}"> and
also in the text content e.g. <p>Blah blah: {foo/bar}</p>

It supports attributes for-each, if, apply-templates, and copy-of. e.g. <li nzetc:for-each="foo/bar">{.}</li>

Obviously the same thing could be easily done with JXT as the target language rather than
XSLT. To my mind, this could be a good thing: the JXT 2 language could have a single (element-driven)
syntax for everything, and we could use XSLT to convert from this attribute-driven syntax,
or indeed from any other attribute-driven syntax that people wanted, if they felt a need for
another attribute (is that FS?)

Cheers

Con

Mime
View raw message