[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

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
xsl example randomize
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.