#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    2
    Rep Power
    0

    Last() fucntion problem. how Can I find that this elment is last in that level.


    How Can I find that this elment is last in that level. Do not want to consider the child level.

    I need to call some fucntion on equal-to if its not last() in same group & if its last I need to call some closing function.
    But I may have <equal-to> in child level too & i don't want to consider them in that loop.

    //I loop through equal-to


    <multi-or>
    <equal-to>
    <literal:string>1a</literal:string> // position 1 , last 2
    </equal-to>
    <equal-to>
    <literal:string>1b</literal:string> // position 2 , last 2 , so here I can close it using test="position()=last()"
    </equal-to>
    </multi-or>
    <multi-or>
    <equal-to>
    <literal:string>2</literal:string> // position 1 , last 3 , here is problem... I need to close it here but test="position()=last()" is false here
    </equal-to>
    <multi-or>
    <equal-to>
    <literal:string>3a</literal:string> // position 1 , last 2
    </equal-to>
    <equal-to>
    <literal:string>3b</literal:string> // position 2 , last 2 , so here I can close it using test="position()=last()"
    </equal-to>
    </multi-or>
    </multi-or>
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    2
    Rep Power
    0
    succes by using follwing
    <xsl:when test="name(following-sibling::*[1]) != 'equal-to' ">
    in place of
    <xsl:when test="position()=last()">

IMN logo majestic logo threadwatch logo seochat tools logo