cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zvi <the...@ifrance.com>
Subject Re: conditional </tr><tr> generation ???
Date Tue, 20 Jun 2000 13:36:47 GMT
sorry :))

I was thinking about something like this, not tried, but u need to think in this
direction...

<table>
     <xsl:for-each select="group">
        <xsl:case>
             <xsl:when test="position() mod 4 = 0">
                 <tr>
                     <td> blablabla </td>
                  </tr>
             </xsl:when>
            <xsl:otherwise>
                   <td> blablabla </td>
            </xsl:otherwise>
        </xsl:case>
     </xsl:for>
</table>


Zvi wrote:

> try this:
>
> <table>
>      <xsl:for-each select="group">
>          <xsl:if test="position() mod 4 = 0">
>              <tr>
>         </xsl:if>
>          <td> blablabla </td>
>          <xsl:if test="position() mod 4 =0">
>              </tr>
>          </xsl:if>
>      </xsl:for>
> </table>
>
> Holger Schmidt wrote:
>
> > Hi,
> > I have a xml file with several items called <group>
> > now i want to build table with 4 <group> items in a row
> >
> > I open a table and start the first row, then i insert the TD's  within
> > a <xsl:for-each select="group"> loop
> > after every 4th TD i want to close the row and then start a new one.
> >
> > However for some reason the parser has a problem with inserting the </tr>
<tr>
> > every 4th row. but when i use text instead of tags " <tr> -> '[' and <td>
> > -> '('  "
> > everyting looks like it should be.
> >
> > The parser thinks i don't close the <xsl:if> tag.
> > Probably im doing something i shouldn't, but what other way could i go?
> >
> > this is my sample code which is not working
> >
> > <table>
> >    <tr>
> >      <xsl:for-each select="group">
> >      <td> blablabla </td>
> >      <xsl:if test="not(position() mod 4)">
> >        </tr> <tr>
> >      </xsl:if>
> >    </tr>
> > </table>
> >
> > and this the one that is working (but not usefull)
> >
> > <table>
> >    <xsl:text>[</xsl:text>
> >      <xsl:for-each select="group">
> >      <xsl:text>(</xsl:text> blablabla <xsl:text>)</xsl:text>
> >      <xsl:if test="not(position() mod 4)">
> >        <xsl:text>] [ </xsl:text>
> >      </xsl:if>
> >     <xsl:text>]</xsl:text>
> > </table>
> >
> > H.
> >
> > --
> > Holger Schmidt  - email: hschmidt@chronolabs.de
> > phone: ++4989 55869988  -  fax: ++4989 55869966
> > Chronolabs GmbH - Landwehrstr. 5 - 80336 Munich
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message