Link to home
Start Free TrialLog in
Avatar of tesmc
tesmcFlag for United States of America

asked on

Xslt: how to use use for each to loop through four iterations only

How can I use a for-each clause alongside position() to only loop through four iterations?

For example, say I want to display only 4 employees whose last name is Doe even though I have a list of 7 employees . How would I note that?
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

to only pick the first four iterations...

<xsl:for-each select="employee[lastname = "Doe"][position() &lt;= 4]">...

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tesmc

ASKER

thank you.