Re: Using Variables to determine which node to use (ASP and XSL issue)

Subject: Re: Using Variables to determine which node to use (ASP and XSL issue)
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 14 Nov 2000 11:17:51 +0000
Greg,

It's kinda hard to tell what your question is ;)  I think it's to do
with:

> I need to then pass that information to the .xsl and use that to
> determin which node to display ( home, info, contact....).

What you're after are stylesheet parameters.  You declare them at the
top level of your stylesheet (with a default value if you want):

<xsl:param name="item" select="'home'" />

and pass them into the stylesheet in a processor specific way.  For
MSXML, you use .addParameter:

  XSLTProcessor.addParameter('item', 'info');

[see the MSXML SDK documentation]

You can then use them within your stylesheet as you would any
variable.  For example:

  <xsl:choose>
    <xsl:when test="$item = 'contact'">
      <!-- display stuff about contacts -->
    </xsl:when>
    <xsl:when test="$item = 'info'">
      <!-- display stuff about info -->
    </xsl:when>
    <xsl:otherwise>
      <!-- display stuff about home -->
    </xsl:otherwise>
  </xsl:choose>

I hope that helps point you in the right direction, but do barrage us
with more specific questions if not.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread