cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier BETHERY <obeth...@capgemini.fr>
Subject Re: permit quoting
Date Fri, 21 Jul 2000 13:26:43 GMT


tcurdt@dff.st wrote:
> 
> In my xslt file I'm trying to have
> a new tablerow every 6th element like this:
> 
> <xsl:template match="rillings">
>   <table>
>     <tr>
>       <xsl:for-each select="rill">
>         <xsl:call-template name="rill"/>
>         <xsl:if test="not(position() mod 6)">
>          <xsl:text disable-output-escaping="no">
>           <![CDATA[[ </tr><tr> ]]>
>          </xsl:text>
>         </xsl:if>
>       </xsl:for-each>
>     </tr>
>   </table>
> </xsl:template>
> 
> This is how I got it from a XSLT book. But since
> this wasn't working I just tried this:
> 
> <![CDATA[[ </tr><tr> ]]>
> =cocoon=>
> [ &lt;/tr&gt;&lt;tr&gt;
> 
> <xsl:text disable-output-escaping="yes">
> <![CDATA[[ </tr><tr> ]]>
> &lt;/tr&gt; &lt;tr&gt;
> </xsl:text>
> =cocoon=>
> <?xslt-next-is-raw formatter-to-dom?>
> <?xslt-next-is-raw formatter-to-dom?>[ &lt;/tr&gt;&lt;tr&gt;
> <?xslt-next-is-raw formatter-to-dom?>
> <?xslt-next-is-raw formatter-to-dom?>&lt;
> <?xslt-next-is-raw formatter-to-dom?>/tr
> <?xslt-next-is-raw formatter-to-dom?>&gt;
> <?xslt-next-is-raw formatter-to-dom?>
> <?xslt-next-is-raw formatter-to-dom?>&lt;
> <?xslt-next-is-raw formatter-to-dom?>tr
> <?xslt-next-is-raw formatter-to-dom?>&gt;
> <?xslt-next-is-raw formatter-to-dom?>
> 
> <xsl:text disable-output-escaping="no">
> <![CDATA[[ </tr><tr> ]]>
> &lt;/tr&gt; &lt;tr&gt;
> </xsl:text>
> =cocoon=>
> [ &lt;/tr&gt;&lt;tr&gt;
> &lt;/tr&gt; &lt;tr&gt;
> 
> How can I prevent Cocoon from quoting everything?
> Even in the CDATA tag?


I don't know but the following template may help u 

<xsl:template name="grid" match="rill">
  <xsl:param name="column">6</xsl:param>
  <xsl:for-each select="rill[position() mod $column = 1]">
  <tr>
      <xsl:for-each select="self::rill |
following-sibling::rill[position() &lt; $column]">
	  <td><xsl:apply-templates/></td>
      </xsl:for-each>
  </tr>
  </xsl:for-each>

</xsl:template>

<xsl:template match="rill">process rill</xsl:template>

<xsl:template match="rillings">
<table>
  <xsl:call-template name="grid" select="rill"/>
</table>
</xsl:template>

Mime
View raw message