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

RE: "for-each" doubt

Subject: RE: "for-each" doubt
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Wed, 11 Oct 2000 09:44:41 +0100
for each call temp xsl
Assuming the id values are monotonic ascending integers

<xsl:for-each select="//FIELD">
  <tr>
    <td><xsl:value-of select="@label"/></td>
    <td><xsl:apply-templates/></td>
  </tr>
</xsl:for-each>

If not, add an <xsl:sort> to sort by @id, and/or change the to select to
something like
"//FIELD[@id &lt; 20]". Can't judge this without seeing your data.

Mike Kay

> -----Original Message-----
> From: Luis Neves [mailto:lneves@xxxxxxxxxx]
> Sent: 10 October 2000 13:52
> To: xsl-list@xxxxxxxxxxxxxxxx
> Subject: "for-each" doubt
> 
> 
> Hello everyone,
> This is a newbie doubt, i hope you forgive me.
> I have a stylesheet that looks like this:
> 
> <TABLE>
>  <TR>
>   <TD><xsl:value-of select="//FIELD[@id='1']/@label"/></TD>
>    <TD><xsl:apply-templates select="//FIELD[@id='1']"/></TD>
>  </TR>
>  <TR>
>    <TD><xsl:value-of select="//FIELD[@id='2']/@label"/></TD>
>    <TD><xsl:apply-templates select="//FIELD[@id='2']"/></TD>
>  </TR>
>    .................
>   <TR>
>     <TD><xsl:value-of select="//FIELD[@id='20']/@label"/></TD>
>     <TD><xsl:apply-templates select="//FIELD[@id='20']"/></TD>
>   </TR>
> 
> And I want to change it into something like this :
> <TABLE>
>       <xsl:for-each select="//FIELD">
>             <TR>
>               <TD><xsl:value-of select="XXXXX"/></TD>
>               <TD><xsl:apply-templates select="YYYYY"/></TD>
>             </TR>
>       </xsl:for-each>
> </TABLE>
> 
> The problem I'm having is that I don't know what to put in 
> the in XXXXXX and
> YYYYY.
> I wonder if anyone can help me with this?
> Thanks,
> 
> Luis Neves
> 
> 
> 
> 
>  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
  • "for-each" doubt
    • Luis Neves - Tue, 10 Oct 2000 13:52:22 +0100
      • <Possible follow-ups>
      • Kay Michael - Wed, 11 Oct 2000 09:44:41 +0100 <=

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.