This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Multiple Rows in a Table / Same Element
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Multiple Rows in a Table / Same Element
- From: "Pinto, Rebecca" <rebecca dot pinto at epresence dot com>
- Date: Thu, 10 Aug 2000 12:08:52 -0400
- Reply-To: xsl-list at mulberrytech dot com
Thanks Paulo. I misinterpreted the original instructions from Mike Brown,
my mistake. I figured it out and it works fine now...Thanks Again!
Rebecca Pinto
-----Original Message-----
From: Paulo Gaspar [mailto:paulo.gaspar@krankikom.de]
Sent: Wednesday, August 09, 2000 4:51 PM
To: xsl-list@mulberrytech.com
Subject: RE: Multiple Rows in a Table / Same Element
That does not follow Mike Brown's instructions. Please read them again.
The <td/> tags should be place by the "day" matching template as he
wrote:
<xsl:template match="day">
<td><xsl:value-of select="@date"/></td>
</xsl:template>
not in the "month" matching template as you wrote.
Maybe you are missing the above day matching template and then you
tried to make it work by placing the <td/> tags in the wrong place.
Read Mike's first posting again and you will find the above "day"
template piece missing from your puzzle.
Boa sorte.
Have fun,
Paulo Gaspar
> -----Original Message-----
> From: owner-xsl-list@mulberrytech.com
> [mailto:owner-xsl-list@mulberrytech.com]On Behalf Of Pinto, Rebecca
> Sent: Wednesday, August 09, 2000 09:36
> To: 'xsl-list@mulberrytech.com'
> Subject: RE: Multiple Rows in a Table / Same Element
>
>
>
> Thanks Mike Brown and Mike Kay for your help. I was able to get
> the rows I
> needed but is there a way to get each individual date within it's own <TD>
> tags?? Currently the days are all in one <TD> tag for each row. Thanks
> Again!
> Rebecca Pinto
>
>
> Mike Brown wrote:
>
> Be careful about the use of mod and position(); the first node is at
> position 1, and you want positions 1, 8, 15, etc., not 0, 7, 14 -- so it
> would be position() mod 7 = 1.
>
> <xsl:template match="month">
> <xsl:for-each select="day[position() mod 7 = 1]">
> <tr>
> <xsl:apply-templates select=". | following-sibling::day[position()
> < 7]"/>
> </tr>
> </xsl;for-each>
> </xsl:template>
>
> This is what I used:
>
> <xsl:template match="Month">
> <xsl:for-each select="day[position() mod 7 = 1]">
> <TR>
> <TD><xsl:apply-templates select="./@date |
> following-sibling::day[position() < 7]/@date" /></TD>
> </TR>
> </xsl:for-each>
> </xsl:template>
>
> And the output is this:
>
> <TABLE border="1">
> <TR>
> <TD>1234567</TD>
> </TR>
> <TR>
> <TD>891011121314</TD>
> </TR>
> <TR>
> <TD>15161718192021</TD>
> </TR>
> <TR>
> <TD>22232425262728</TD>
> </TR>
> <TR>
> <TD>2930123</TD>
> </TR>
> </TABLE>
>
>
> Original XML:
> <Month>
> > <day date="1" />
> > <day date="2"/>
> > <day date="3" />
> > [...]
> > <day date="31"/>
> > </Month>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list