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

Re: position and loop problem

Subject: Re: position and loop problem
From: henry human <henry_human@xxxxxxxx>
Date: Thu, 14 Aug 2008 15:23:54 +0200 (CEST)
Re:  position and loop problem
Tahnks

>   What do you wanna do exactly?
what i am going to do is, to get the number of the
"section" elements from the XML file, than make a loop
which turns for so many time as the number of the
"section" element existed in the XML file!
I hope i was clear now .



--- Florent Georges <lists@xxxxxxxxxxxx> schrieb:

> henry human wrote:
> 
>   Hi
> 
> > I save the number of a specific node as follow and
> get
> > the right number for the node which is 2:
> >        <xsl:variable name="var"
> >
>
select="count(document/elements/element[@type='section'])"/>
> > However when I try it in a for-each loop as follow
> I
> > get  6 times looping!
> > Hier is the for-each loop:
> 
> > <xsl:for-each select="//*[position() &lt;= $var]">
> 
>   position() doesn't behave as you seem to think it
> does.  What you get
> means there are in the input tree 6 elements that
> are the first or
> second child of their parent element.
> 
>   What do you wanna do exactly?
> 
>   Regards,
> 
> --drkm
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>      
>
_____________________________________________________________________________
> 
> Envoyez avec Yahoo! Mail. Une boite mail plus
> intelligente http://mail.yahoo.fr
> 
> 


__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verf|gt |ber einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 

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.