[Home] [By Thread] [By Date] [Recent Entries]

Subject: Re: LOOP-LIMIT
From: "David B. Bitton" <david@xxxxxxxxxxxxxx>
Date: Fri, 01 Mar 2002 10:16:47 -0500
--ZmUaFz6apKcXQszQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Wouldn't you just do...

<xsl:for-each select=3D"/root/child[number(@id) < 5]">
=2E..
</xsl:for-each>

:)

On Fri, Mar 01, 2002 at 02:54:04PM -0000, cutlass wrote:
>=20
> ----- Original Message -----
> From: "William Rutford" <vsd18@xxxxxxxxxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Sent: Friday, March 01, 2002 2:43 PM
> Subject:  LOOP-LIMIT
>=20
>=20
> >
> > Hi
> > I have a problem .. here it goes..
> >
> > xml structure:
> >
> > <root>
> >   <child id =3D '1'/>
> >   <child id =3D '2'/>
> >   <child id =3D '3'/>
> >   <child id =3D '4'/>
> >   <child id =3D '5'/>
> >   <child id =3D '6'/>
> > </root>
> >
> > i have to run an <xsl:for-each> for the 'child' only till child id
> > =3D '4'..
> > i want to write the condition of the following type
> > if(id > 4)
> >   {
> >    do something..
> >   }
> > else
> >   {
> >    do something else
> >   }
>=20
> try this
>=20
> xslt
> -------------------------------------------------------------------------=
---
> -------
>=20
> <?xml version=3D"1.0"?>
> <xsl:stylesheet version=3D"1.0"
> xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform">
> <xsl:template match=3D"/">
> <xsl:for-each select=3D"//child">
>  <xsl:choose>
> <xsl:when test=3D"number(@id)>4">
>                                                  do something
> </xsl:when>
>=20
> </xsl:choose>
> </xsl:for-each>
>=20
>  </xsl:template>
> </xsl:stylesheet>
>=20
> cheers, jim fuller
>=20
> >
> > can some one suggest me a way tro do that??
> > thanks
> > vasu
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
>=20
>=20
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

--=20

David B. Bitton
david@xxxxxxxxxxxxxx

Diversa ab illis virtute valemus.

--ZmUaFz6apKcXQszQ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8f5tfMNOMzNRRk50RAr8qAKCr6auPmMSCGzPVZSntcXPf+s34GQCgndDT
jYvTAtwYXfOcQ+nNEe0m6Vs=
=iKRt
-----END PGP SIGNATURE-----

--ZmUaFz6apKcXQszQ--

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


Current Thread
  • LOOP-LIMIT
    • William Rutford - Fri, 1 Mar 2002 09:41:44 -0500 (EST)
      • cutlass - Fri, 1 Mar 2002 09:56:52 -0500 (EST)
        • David B. Bitton - Fri, 1 Mar 2002 10:13:14 -0500 (EST) <=
      • naha - Fri, 1 Mar 2002 10:09:16 -0500 (EST)
      • <Possible follow-ups>
      • Corey_Haines - Fri, 1 Mar 2002 09:54:14 -0500 (EST)
        • Hans Huber - Fri, 1 Mar 2002 10:08:26 -0500 (EST)
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member