This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: LOOP-LIMIT
- From: naha at ai dot mit dot edu
- To: xsl-list at lists dot mulberrytech dot com, William Rutford <vsd18 at rediffmail dot com>
- Date: Fri, 01 Mar 2002 10:12:45 -0500 (EST)
- Subject: Re: [xsl] LOOP-LIMIT
- References: <20020301144342.17881.qmail@mailweb9.rediffmail.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Quoting William Rutford <vsd18@rediffmail.com>:
>
> Hi
> I have a problem .. here it goes..
>
> xml structure:
>
> <root>
> <child id = '1'/>
> <child id = '2'/>
> <child id = '3'/>
> <child id = '4'/>
> <child id = '5'/>
> <child id = '6'/>
> </root>
>
> i have to run an <xsl:for-each> for the 'child' only till child id
> = '4'..
> i want to write the condition of the following type
> if(id > 4)
> {
> do something..
> }
> else
> {
> do something else
> }
>
> can some one suggest me a way tro do that??
Put something like
<xsl:choose>
<xsl:when test="@id > 4">
do something..
</xsl:when>
<xsl:otherwise>
do something else
</xsl:otherwise>
</xsl:choose>
in your loop. Will that do what you're looking for?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list