This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Using Variables to determine which node to use (ASP and XSL issue)
- To: "Greg Miley" <greg at neosmart dot com>
- Subject: Re: Using Variables to determine which node to use (ASP and XSL issue)
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Tue, 14 Nov 2000 11:17:51 +0000
- CC: xsl-list at mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <43B60FE6D5254646827819E5DBB94BE80153A1@neosmart.neosmart.neosmart.com>
- Reply-To: xsl-list at mulberrytech dot com
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