This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: XSL variable...


> in one template I wrote
> 
> 	<xsl:variable name="wasLeft" select="'0'"/>
> 
> 
> In other one
> 
> 	<xsl:variable name="wasLeft" select="'1'"/>
> 
These are two different variables, and any reference to $wasLeft will have
only one of these declarations in scope.

You need to declare a single variable, and set its value conditionally:

<xsl:variable name="wasLeft">
  <xsl:choose>
    <xsl:when test="some condition">0</xsl:when>
    <xsl:otherwise>1</xsl:otherwise>
  </xsl:choose>
</xsl:variable>

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]