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

problem defining param value

Subject: problem defining param value
From: Jonina Dames <jdames@xxxxxxxxx>
Date: Tue, 08 Jan 2013 15:32:56 -0500
 problem defining param value
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@xxxxxxxxx

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

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.