XML - XSLT Parameter Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • willyp
    New Member
    • Jun 2007
    • 2

    XML - XSLT Parameter Question

    Hello,

    I am developing a website that has a drop down menu populated with 'user types' ie: customers, buyers, ect...

    And below this menu is a list of links.

    This list of links changes based on the selection of user type chosen.

    So the XML would look like this for each link:

    <link>
    <title>Headline </title>
    <url>link-to-page.html</url>
    <users>customer s</users> <!--User type(s) in this element-->
    </link>

    So far we have been filtering our data in the following way through XSL:

    <xsl:if test="contains( users,'customer s')">


    This works fine, however, we would like a way of passing a variable to
    the xsl file so that we don't have to have a different xsl file to
    filter each user role.

    So perhaps it would look like this:

    <xsl:if test="contains( users,'$user')" >

    with

    $user

    being the variable.

    Is it possible to pass a variable from the browser (via javascript or
    something else) to the xsl file so that we can use one xsl file as our
    filter?

    Thanks a lot, and if this was completely confusing, I apologize.

    -WillyP
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Greetings!

    Have a look here:

    Sorry! We can't seem to find the resource you're looking for

    Comment

    Working...