xsl-list
[Top] [All Lists]

Re: Assigning a value to a variable failure

2005-02-21 15:12:25
Are all the variables at the highest level of the spreadsheet (that is, 
outside of any templates)?

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)



"tom tom" <tomxsllist(_at_)hotmail(_dot_)com> 
02/21/2005 04:07 PM
Please respond to
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com


To
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
cc

Subject
[xsl] Assigning a value to a variable failure






If I have the following variables:

<xsl:variable name="section_num2">
  <xsl:choose>
    <xsl:when test="/ROOT/PARAMS/PARAM[NAME='s_id']">
                 <xsl:value-of 
select="/ROOT/PARAMS/PARAM[NAME='s_id']/VALUE"/>
    </xsl:when>
    <xsl:otherwise>1</xsl:otherwise>
  </xsl:choose>
</xsl:variable>

<xsl:variable name="section_num" select="number($section_num2)"/>

I have a further variable and template:

<xsl:variable name="current_page">
<xsl:call-template name="find_current_page"/>
</xsl:variable>

<xsl:template name="find_current_page">
<xsl:value-of select="$section_num2"/>
</xsl:template>

When i reference the variable $current_page, the value of $section_num2 is 

not returned, nothing is returned, yet when I call the template name 
'find_current_page' directly the correct value is returned, can anyone 
tell 
me why? I am using MSXML 3 in XML Spy, these templates are part of a much 
larger stylesheet, they are definately not being overridden anywhere.

Thanks

Tom

_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger


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




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