cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: [Design] JXTG 2.0 (generator and transformer, same template syntax?)
Date Wed, 08 Dec 2004 05:53:48 GMT
Roy G. Biv wrote:
> I'm almost afraid to bring this up since I'm coming from a point of view 
> where I actually like XSLT.  Yes, I'm one of *those* people.  ;-)
> 
> But when I saw this:
> 
>> Bertrand Delacretaz wrote:
>>
>>> Then, Bob, who's in charge of the final presentation, writes another 
>>> template to convert this logical document to, say, "lightweight 
>>> HTML", for an embedded terminal (no CSS). This gets processed by the 
>>> XYZTransformer, which uses the same template and expression engines, 
>>> and the same syntax as the XYZGenerator (again, don't worry about 
>>> syntax details):
>>>
>>> <html>
>>>   <head><title>${page/title}</title></head>
>>>   <body>
>>>     <table>
>>>       <tr tl:iter="p in page/person-list">
>>>           <td>${p/name}</td>
>>>           <td>${p/age}</td>
>>>       </tr>
>>>     </table>
>>>   </body>
>>> </html>
>>
>>
> 
> Aside from missing the "tl" namespace declaration, I was curious if 
> people are keeping in mind that the equivalent XSLT stylesheet is:
> 
> <html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>  <head><title><xsl:value-of select="page/title"/></title></head>
>  <body>
>    <table>
>      <xsl:for-each select="page/person-list">
>        <tr>
>            <td><xsl:value-of select="name"/></td>
>            <td><xsl:value-of select="age"/></td>
>        </tr>
>      </xsl:for-each>
>    </table>
>  </body>
> </html>
> 
> This is an XSLT 1.0 literal result element as stylesheet.  
> (http://www.w3.org/TR/xslt#result-element-stylesheet)
> 
> I wanted to point out that XSLT can be used in the same (procedural) 
> model as is being proposed in the two-step template models.  More 
> elements and fewer dollar signs though.  It also leaves the door open 
> for more complex transformations if needed (using full XSLT) and allows 
> the documentation load to be distributed by other projects.  That and 
> XSLT transformers have already been performance tuned.
> 
> Don't get me wrong, I like the attribute syntax as much as the next guy.
> 
> Just saying...

Yes, we are aware of this. It does feel askward, to be honest, to have 
an XSLT generator, some groups really should buy my FS alarms ;-)

[Bertrand, I just built a new one, and it's way more sensible and 
resistent too, and recharges itself when spots signs of FS... it will 
never run out of batteries overhere ;-)]

-- 
Stefano.


Mime
View raw message