This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: LOOP-LIMIT



----- Original Message -----
From: "William Rutford" <vsd18@rediffmail.com>
To: <xsl-list@lists.mulberrytech.com>
Sent: Friday, March 01, 2002 2:43 PM
Subject: [xsl] LOOP-LIMIT


>
> 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
>   }

try this

xslt
----------------------------------------------------------------------------
-------

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="/">
<xsl:for-each select="//child">
 <xsl:choose>
<xsl:when test="number(@id)>4">
                                                 do something
</xsl:when>

</xsl:choose>
</xsl:for-each>

 </xsl:template>
</xsl:stylesheet>

cheers, jim fuller

>
> can some one suggest me a way tro do that??
> thanks
> vasu
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]