cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy G. Biv" <>
Subject Re: [Design] JXTG 2.0 (generator and transformer, same template syntax?)
Date Wed, 08 Dec 2004 02:39:21 GMT
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="">
  <head><title><xsl:value-of select="page/title"/></title></head>
      <xsl:for-each select="page/person-list">
            <td><xsl:value-of select="name"/></td>
            <td><xsl:value-of select="age"/></td>

This is an XSLT 1.0 literal result element as 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...

- Miles Elam

View raw message