This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: LOOP-LIMIT
--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@rediffmail.com>
> To: <xsl-list@lists.mulberrytech.com>
> Sent: Friday, March 01, 2002 2:43 PM
> Subject: [xsl] 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@codenoevil.com
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