[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Multiple Rows in a Table / Same Element

Subject: RE: Multiple Rows in a Table / Same Element
From: "Paulo Gaspar" <paulo.gaspar@xxxxxxxxxxxx>
Date: Wed, 9 Aug 2000 22:50:48 +0200
table of 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@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()
> &lt; 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() &lt; 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.