| | |
Param not incrementing in for-each
Please support our XML, XSLT and XPATH advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2009
Posts: 2
Reputation:
Solved Threads: 0
Hello,
I am currently trying to use the code below to increment the currentChild after every iteration. However, in the output shown below, it is apparent that the value is never changing.
There are four children in this example, so it is printing out the statements the correct number of times, just not incrementing the value.
What can I do to keep track of the currentChild count?
Thanks.
Code:
Output:
0 before increment
0 after increment
0 before increment
0 after increment
0 before increment
0 after increment
0 before increment
0 after increment
I am currently trying to use the code below to increment the currentChild after every iteration. However, in the output shown below, it is apparent that the value is never changing.
There are four children in this example, so it is printing out the statements the correct number of times, just not incrementing the value.
What can I do to keep track of the currentChild count?
Thanks.
Code:
XML, XSLT and XPATH Syntax (Toggle Plain Text)
<xsl:param name="currentChild">0</xsl:param> <xsl:for-each select="Attribute[./@name='Children.Name']/Value"> <xsl:value-of select="$currentChild"/> before increment<br/> <xsl:with-param name="currentChild" select="$currentChild+1"/> <xsl:value-of select="$currentChild"/> after increment<br/> </xsl:for-each>
Output:
0 before increment
0 after increment
0 before increment
0 after increment
0 before increment
0 after increment
0 before increment
0 after increment
![]() |
Similar Threads
- Need help incrementing... (Python)
- default param same as function param? (C++)
- Cold fusion do not support input param: Help (ColdFusion)
- Help incrementing time in my class (Java)
- arrays passed to methods and keyword param (C#)
- NEED HELP! on displaying incrementing #s (C++)
- Incrementing a vectors element? (C++)
- problem with incrementing numbers in a file (Perl)
Other Threads in the XML, XSLT and XPATH Forum
- Previous Thread: Replacing ampersand and single quote in XSLT
- Next Thread: Xpath Corelate Parent With Variable number Of Children
Views: 911 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for XML, XSLT and XPATH
api blogger blogging code dataset delete development dynamiccreationofnvariablesinxslt error firstthreecharacterofastringrequired flipbook gdata google html include java link linspire linux microsoft news node openoffice overwrite precedence programming rss serialization standards swf template transform variable w3c web xml xmlnotloading xmlonserver xsl xslt





