Re: possible to mimic while-like behavior?

Subject: Re: possible to mimic while-like behavior?
From: Mike Brown <mike@xxxxxxxx>
Date: Thu, 16 Mar 2000 14:32:32 -0700 (MST)
> e.g., speaking in a Perl-esque way, I want
>   while ($foo != "bar") {
>     blah
>   }
> 
> Is there any way to simulate, hack, or otherwise achieve this?

<xsl:template match="baz">
  <xsl:call-template name="while">
    <xsl:with-param name="foo" select="$foo"/>
  </xsl:call-template>
</xsl:template>

<xsl:template name="while">
  <xsl:param name="foo"/>
  <xsl:param name="bar"/>
  <xsl:if test="not($foo='bar')">
    <!-- begin blah -->
    <xsl:variable name="newfoo" select="maz"/>
    <!-- end blah -->
    <xsl:call-template name="while">
      <xsl:with-param name="foo" select="$newfoo"/>
    </xsl:call-template>
  </xsl:if>
</xsl:template>

   - Mike
___________________________________________________________
Mike J. Brown, software engineer, Webb Interactive Services
XML/XSL stuff: http://www.skew.org/    http://www.webb.net/


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


Current Thread