[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: apply-imports and recursion used together

Subject: RE: apply-imports and recursion used together
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 5 Mar 2003 19:53:55 -0000
apply imports works
Perhaps you are thinking that xsl:apply-imports passes the parameters on
to the invoked template rule. It doesn't. Apply-imports doesn't allow
parameters to be passed in 1.0, either explicitly or implicitly. This is
fixed in 2.0.

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Tom Whitehouse
> Sent: 05 March 2003 17:15
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  apply-imports and recursion used together
> 
> 
> Can someone explain to me the technical reason behind the following:
> 
> The following template exists in an imported stylesheet:
> 
> <xsl:template match="FORUMTHREADPOSTS" mode="postblocks">
> 	<xsl:param name="skip" select="0"/>
> 	<xsl:param name="PostRange" select="concat(($skip + 1), 
> ' - ', ($skip + 
> @COUNT))"/>
> 	<xsl:param name="postblockon" 
> select="concat($alt_nowshowing, ' ', 
> $PostRange)"/>
> 	<xsl:param name="postblockoff" select="concat($alt_show, ' ', 
> $PostRange)"/>
> 	<a 
> href="{$root}F{@FORUMID}?thread={@THREADID}&amp;skip={$skip}&a
> mp;show={@COUNT}">
> 		<xsl:choose>
> 			<xsl:when test="@SKIPTO = $skip">
> 				<xsl:copy-of select="$postblockon"/>
> 			</xsl:when>
> 			<xsl:otherwise>
> 				<xsl:copy-of select="$postblockoff"/>
> 			</xsl:otherwise>
> 		</xsl:choose>
> 	</a>
> 	<xsl:if test="($skip + @COUNT) &lt; @TOTALPOSTCOUNT">
> 		<xsl:apply-templates select="." mode="postblocks">
> 			<xsl:with-param name="skip" 
> select="$skip + @COUNT"/>
> 		</xsl:apply-templates>
> 	</xsl:if>
> </xsl:template>
> 
> The template works in the way I would expect it. However if 
> an apply-imports 
> template is used in the including template I get an infinite loop:
> 
> <xsl:template match="FORUMTHREADPOSTS" mode="postblocks">
>    <xsl:apply-imports/>
> </xsl:template>
> 
> reagrds
> 
> Tom
> 
> _________________________________________________________________
> Surf together with new Shared Browsing 
> http://join.msn.com/?page=features/browse&pgmarket=en-gb&XAPID
> =74&DI=1059
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.