xsl-list
[Top] [All Lists]

[xsl] problem defining param value

2013-01-08 14:33:14
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"/>
</xsl:when>

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

$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"/>
</param_set>

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"/>
</param_list>
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:variable>

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

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?

Thanks,
Joni

--
Jonina Dames
Customer Support Specialist
Inera Inc.
+1 617 932 1932
jdames(_at_)inera(_dot_)com

-------------------------------------------------------------------
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.
-------------------------------------------------------------------


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>