Copied to clipboard

Flag this post as spam?

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


  • manwood 87 posts 109 karma points
    Apr 04, 2010 @ 16:34
    manwood
    0

    How to conditionally set a variable in XSLT?

    Hi

    I am looking for an XSLT pattern to do the following:

    • declare a variable that will hold a set of nodes
    • conditionally set the variable declared above depending on a number of conditions (ie use a 'choose - when - when' structure)
    • use the conditional variable in a for-each statement once it has been set

    I'm not quite sure how to go about this in XSLT. I know I can use the choose/when construct, but how do I declare a variable in global scope, set it to a value, then use it later?

    thanks

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Apr 04, 2010 @ 18:05
    Chriztian Steinmeier
    0

    Hi manwood,

    Take a look at the solution provided in this Forum post - that's your pattern right there. 

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft