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

Re: problems in loop creation in a table--help requ

Subject: Re: problems in loop creation in a table--help required..
From: "Praveen G" <praveeng@xxxxxxxxxxxx>
Date: Mon, 1 Oct 2001 13:19:27 +0800
loop tr td
Hi paul,
Thanks alot for solving my problem.
regards,
praveen
----- Original Message -----
From: "Paul Tyson" <paul@xxxxxxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, September 28, 2001 10:39 PM
Subject: Re:  problems in loop creation in a table--help required..


> Here's one way to do it:  Build the subsystem_id table like so:
>
>             <TBODY>
>               <TR>
>                 <TD>00-3f</TD>
>                 <xsl:apply-templates
>                   select="subsystem_id[position() mod 4 = 1]"/>
>               </TR>
>               <TR>
>                 <TD>40-7f</TD>
>                 <xsl:apply-templates
>                   select="subsystem_id[position() mod 4 = 2]"/>
>               </TR>
>               <TR>
>                 <TD>80-Bf</TD>
>                 <xsl:apply-templates
>                   select="subsystem_id[position() mod 4 = 3]"/>
>               </TR>
>               <TR>
>                 <TD>C0-FF</TD>
>                 <xsl:apply-templates
>                   select="subsystem_id[position() mod 4 = 0]"/>
>               </TR>
>             </TBODY>
>
> Add a template for subsystem_id, like:
>   <xsl:template match="subsystem_id">
>     <td>
>       <xsl:apply-templates/>
>     </td>
>   </xsl:template>
>
> Your code will work if you change 'call-template' to 'apply-templates',
and
> change the 'match' attribute to 'select'.  But you'll also need to add
> conditions for all 64 possible subsystem_ids.  Selecting with a
'position()
> mod 4' expression reduces the amount of XSLT code.
>
> If you want to fill out the rows with empty cells, you'll need to call an
> extra named template.  See my recently posted example on this list for a
> similar table construction problem.
>
> Have fun,
> Paul Tyson
>
> ----- Original Message -----
> From: "Praveen G" <praveeng@xxxxxxxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Sent: Thursday, September 27, 2001 10:31 PM
> Subject:  problems in loop creation in a table--help required..
>
> [ excess code sample omitted ]
>
> >     <TBODY>
> >
> >           <TR>
> >      <TD>00-3f</TD>
> > <TD><xsl:call-template match="subsystem_id[position()=1 or
> > position()=5]"/></TD>
> >            </TR>
> >            <TR>
> >    <TD>40-7f</TD>
> > <TD><xsl:call-template match="subsystem_id[position()=2 or
> position()=6]"/>
> > </TD>
> >          </TR>
> >            <TR>
> >   <TD>80-Bf</TD>
> > <TD><xsl:call-template match="subsystem_id[position()=3 or
> position()=7]"/>
> > </TD>
> >           </TR>
> >              <TR>
> >     <TD>C0-FF</TD>
> > <TD><xsl:call-template match="subsystem_id[position()=4 or
> position()=8]"/>
> > </TD>
> >           </TR>
> >   </TBODY>
>
>
>
>  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.