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: Variable Scope and xsl:if


>     It's clear I can't query this variable from outside the <xsl:if>
> because of the variable scope, so, what's the solution?

<xsl:variable name="xxx">
  <xsl:if test="condition">1</xsl:if>
  <xsl:if test="not(condition)">2</xsl:if>
<xsl:variable>

or if you want the result to be a node-set:

<xsl:variable name="xxx" select="value1[condition] |
value2[not(condition)]"/>

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]