Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • DavidS 17 posts 38 karma points
    May 11, 2010 @ 00:17
    DavidS
    0

    XSLT previous next button with a twist

    Hi all,

    I was wondering if anyone could help out on the following problem. I've got the following site structure

     

    Questionnaire

         Stage 1

              Page 1

              Page 2

              Page 3

         Stage 2

              Page 4

              Page 5

     

    Now only the contents of "Page 1" to "Page 5" will only ever be shown to the user. What I want to implement is pagination of "Page 1" to "Page 5". 

    So for instance, if the user is on "Page 1", I'd like only a "Next" button to appear. Likewise if the user were to be on "Page 5" only a "Previous" button should appear. Similarly if the user were to be on any other page, both the "Next" and "Previous" buttons would appear.

    I've tried using $currentPage/preceding-slbling and $currentPage/following-sibling but due to the structure of the site, "Page 3" and "Page 4" are problematic since they are child nodes of "Stage 1" and "Stage 2" respectively.

    Is this one of the situations where I'd be better off using .NET to implement the macro? Or is there a clever way of doing it in XSLT?

     

    TIA

    David

     

     

     

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    May 11, 2010 @ 15:34
    Sebastiaan Janssen
    0

    You could probably use just "following"  and filter by level (something like @level = 2). Check out this cool XSLT axis tool.

    Or, if the questions all have a different docType, just get all of the nodes with that docType.

Please Sign in or register to post replies

Write your reply to:

Draft