Subject: RE: Multiple Rows in a Table / Same Element From: "Paulo Gaspar" <paulo.gaspar@xxxxxxxxxxxx> Date: Wed, 9 Aug 2000 22:50:48 +0200 |
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@xxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Pinto, Rebecca > Sent: Wednesday, August 09, 2000 09:36 > To: 'xsl-list@xxxxxxxxxxxxxxxx' > 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Multiple Rows in a Table / Same, Pinto, Rebecca | Thread | RE: Multiple Rows in a Table / Same, Matthew Bentley |
Encountered end of file....., Shelly Nippard | Date | RE: ?MSXML transformNode, Paulo Gaspar |
Month |