[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: <xsl:for-each> , only loop on half of the element

Subject: Re: <xsl:for-each> , only loop on half of the elements.
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 26 Jul 2010 16:14:42 +0100
Re:   <xsl:for-each>
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.