cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Merico Raffaele <>
Subject AW: Templating: experiments with Conal's html-to-xslt transform
Date Fri, 10 Dec 2004 14:05:52 GMT
Hi Bertrand

As you maybe remember, this level of SOC is a main topic of my job.
Although I do not understand all details of the attribute-based
transformation, I actually see the following limitations (L) and
disadvantages (D):

L) The HTML-template to XSLT transformation is limited to one "level" of
data access (i.e. what do you do if you want to process XPATH expressions
that are in the XML-data stream?).

L) How would you solve case specific (if) rendering within a for-each="..."?

D) I'm not sure if the web designers would be very happy to work with a
mixed XSL/XPATH syntax, that's not familiar to them (i.e. <div
apply-templates="node()"/> or <h2>{@title}</h2>).

D) This approach needs an additional transformation step.

In my opinion for the web designer it would be enough if they would have
basic tags of procedural logic like <ctpl:if/> and <ctpl:for-each> bundled
with unlimited XPATH capabilities. 

I'm currently porting my "static" template language based on XSLT/XPATH 1.0
to XSLT/XPATH 2.0. As soon it is mature I will make it available for
reflection to this list.


> -----Urspr√ľngliche Nachricht-----
> Von: Bertrand Delacretaz []
> Gesendet: Freitag, 10. Dezember 2004 11:28
> An:
> Cc:
> Betreff: Templating: experiments with Conal's html-to-xslt transform
> (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 ;-)
> -Bertrand
> [1]
> [2]
> [3]

View raw message