[xsl] problem defining param value

Subject: [xsl] problem defining param value
From: Jonina Dames <jdames@xxxxxxxxx>
Date: Tue, 08 Jan 2013 15:32:56 -0500
Hi everyone,

I have a stylesheet with the following section:

<!-- use the value passed in by parameter if available -->
<xsl:when test=" $OUTSIDE_PARAM != '' ">
<xsl:value-of select="$OUTSIDE_PARAM"/>

<!-- if no parameter passed, use 'VALUE3' as a fallback; this is the default value -->
<xsl:value-of select=" 'VALUE3' "/>

$OUTSIDE_PARAM was originally being defined as "VALUE1" by the xml file that called in the stylesheet, using the following syntax:
<!-- Parameters to pass to the XSLT processor at runtime. -->
<param_set name="stylesheet-parameters">
<param_set_item item_name="OUTSIDE_PARAM" item_value="VALUE1"/>

But I wanted to be able to define $OUTSIDE_PARAM as either "VALUE1" or "VALUE2" depending on another variable. So I added that variable to another stylesheet, which I called in like so:
<param_list name="additional_stylesheets">
<param_list_item item_value="NEW_STYLESHEET.xsl"/>
from the xml file that calls in the first stylesheet, and used the following syntax in the NEW_STYLESHEET.xsl:

<xsl:variable name="fork1">
<xsl:value-of select="string that returns either 'FORK' or 'SPOON'"/>

<xsl:param name="OUTSIDE_PARAM">
<xsl:if test="$fork1 = 'FORK'">
<xsl:value-of select="string that returns 'VALUE1'"/>
<xsl:if test="$fork1 = 'SPOON'">
<xsl:value-of select="string that returns 'VALUE2'"/>

Unfortunately, the stylesheet is no longer recognizing that a param has been defined at all, and is always defaulting to VALUE3, as determined by the "otherwise" section. It seems to think that $OUTSIDE_PARAM is always empty, even though it's not. Am I missing something completely obvious?


Jonina Dames
Customer Support Specialist
Inera Inc.
+1 617 932 1932

This email message and any attachments are confidential. If you are not the intended recipient, please immediately reply to the sender or call 617-932-1932 and delete the message from your email system. Thank you.

Current Thread