xsl-list
[Top] [All Lists]

Re: [xsl] position and loop problem

2008-08-14 06:24:25
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(_at_)fgeorges(_dot_)org> 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[(_at_)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


--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--