www.webdeveloper.com
Results 1 to 2 of 2

Thread: question for paps

  1. #1
    Join Date
    Sep 2003
    Posts
    3

    question for paps

    Ok, but I don't know how to create a variable that contains a list of nodes (node-set) through a for-each.

    <xsl:variable name"test">
    <xsl:for-each select"initial_list">
    <xsl:value-of select="current()"/>
    </xsl:for-each>
    </xsl:variable>

    I want that variable 'test' to contain a list of nodes.

    Is it possible to do something like this? (to change the value of a variable during a for-each cycle?)

  2. #2
    Join Date
    Sep 2003
    Location
    Australia
    Posts
    37
    Yes it is possible to change a value of variable within a for-each loop...instead of writing this...


    <xsl:variable name"test">
    <xsl:for-each select"initial_list">
    <xsl:value-of select="current()"/>
    </xsl:for-each>
    </xsl:variable>

    y dont u try....

    <xsl:for-each select"initial_list">
    <xsl:variable name"test" select="."/>
    </xsl:for-each>

    "current()" and "." should mean the same, current() becomes different only when used in the context of [] brackets

    This should keep updating the "test" variable with new value, each time it loops through....

    Hope this helps...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles