www.webdeveloper.com
Results 1 to 3 of 3

Thread: XSL - move to next - Please help me

  1. #1
    Join Date
    Nov 2005
    Posts
    2

    XSL - move to next - Please help me

    Hi

    I have very important question (for my). Which function in XSL insted of using this <xsl:for-each select="/root/ShowWithNoUsers/ShowWithNoUser">
    can move to anather element. Please halp me !!!!

    Or mayby Yoy know how in XSL I can incremant veraible, it would be also helpul!!!!


    <xsl:for-each select="/root/ShowWithNoUsers/ShowWithNoUser">
    <td>
    <input type="radio" name="deviceId" value="{IdUser}" id="{IdUser}" onclick="rememberId({IdUser},{id});" />

    <xsl:if test="type = 'Monitor'" >
    <td>
    Screen:
    </td>
    <td> <xsl:variable name="i" select="1">
    <xsl:value-of select="/root/ShowWithNoUsersMonitors/ShowWithNoUserMonitor[i]/sSize" disable-output-escaping="yes"/>
    </xsl:variable>
    </td>
    </xsl:if>


    Thats my problem that I don't know how to view this special elaments ??

  2. #2
    Join Date
    Nov 2005
    Posts
    4
    I'm not sure what exactly you are trying to acheive here.

    You can use <xsl:apply-templates/> in place of <xsl:for-each/> and then define a template to process the element:
    Code:
    <xsl:template match="ShowWithNoUser">
    <td>
    <input type="radio" name="deviceId" value="{IdUser}" id="{IdUser}" onclick="rememberId({IdUser},{id});" />
    ...
    </xsl:template>
    If you always want to use ShowWithNoUserMonitor[1], then drop the variable and just use a 1. To use a variable, you'll need to change it to [$i]. If there is a 1-to-1 correlation, then you should use <xsl:variable name="i" select="position()"/>

  3. #3
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    95
    Once the value of a variable has been set in XSL it can't be changed - it's not really a variable...

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