This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: possible to mimic while-like behavior?
- To: xsl-list at mulberrytech dot com
- Subject: Re: possible to mimic while-like behavior?
- From: Mike Brown <mike at skew dot org>
- Date: Thu, 16 Mar 2000 14:32:32 -0700 (MST)
- Cc: Carole_Mah at brown dot edu
- Reply-To: xsl-list at mulberrytech dot com
> 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