cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <bdelacre...@apache.org>
Subject Re: AW: Templating: experiments with Conal's html-to-xslt transform
Date Fri, 10 Dec 2004 14:19:57 GMT
Le 10 déc. 04, à 15:05, Merico Raffaele a écrit :

> 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):..

Thanks for speaking up!

> 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?).

Hmm...go to straight XSLT maybe?

I currently don't envision using this templating system for more than 
simple/common stuff: keep it simple for simple cases, move up to XSLT 
for the rest.

Actually it would be easy to include partial XSLT transforms in our 
templates, so that the web designer can ask an expert to write the hard 
stuff.

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

<div case="@blast">
   Consecutive div having @case are converted to xsl:choose
</div>
<div case="">
   With a default case of course
</div>

Is that what you mean?

> ...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>).

The node() thing can be easily eliminated by making it the default 
value.

For the rest, I think the advantages in terms of implementation far 
outweigh the disadvantages, people will have to learn some syntax 
anyway.

And not inventing a new syntax means using one that is documented, 
there's tons of XPath info out there.

> ...D) This approach needs an additional transformation step.

Yes, but it's certainly cacheable.

> ...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...

Bring it on, it doesn't need to be mature, experimental is good enough!
Release early, release often...

-Bertrand

Mime
View raw message