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 16:14:42 +0100
On 26/07/2010 16:06, Red Light wrote:
in my xml file that i receive

i got a node: /content/collaborator

and in another node i got /content/collaborator too :

your example is an absolute xpath starting with / and as an xml document (although not admittedly an xdm tree) may only have one element child, /content can only select one element.
If it selects more than one then perhaps your xpath does not start with / ?



so when i do <xsl:for-each select="/content/collaborator"> both got merged ....

That can't happen,

late's consider i got 6 elements on the node:


position() give me like

sorry I can't parse the above,


1
2
3
1
2
3

perhaps you want select="(some/xpath)[position()&lt;= last() div 2]"

with the () around the xpath. I didn't put them in the first time as they were not needed given your description.

so it got not effect here ... any way to do like a loop (for like java/c) with out for-each?

I have no idea what that means?

and thanks.




You may want to read the list guidelines (linked from page links in every message) which give some guidelines on supplying complete small examples and complete small expected results, so as to make questions more understandable.

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