Re: [xsl] <xsl:for-each> , only loop on half of the elements.

Subject: Re: [xsl] <xsl:for-each> , only loop on half of the elements.
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 26 Jul 2010 15:34:20 +0100
On 26/07/2010 15:30, Red Light wrote:


i have a pretty weird use case :

i have a node contained number of elements but late say i got 6 elements i only need to first 3.

Why is that weird? isn't selecting a subset of an xml document what XSLt is mainly designed to do?

<xsl:for-each select="/content/collaborator[position() &lt;= (last() div 2)]"> .


i know that this kind of things should be treated in data source level
... , i'm using apache Fop to print my reports and i use the data that
comes thru a webservices so can't modify it .. any way in my xsl to use
only the NUMBER_OF_ELEMENT / 2 ?


position() &lt;= (last() div 2)]


as above

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________


Current Thread