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

RE: RE: Recursively looping through a template only X

Subject: RE: RE: Recursively looping through a template only X number of times?
From: cknell@xxxxxxxxxx
Date: Tue, 28 Nov 2006 15:06:19 -0500
RE: RE:  Recursively looping through a template only X
I don't where you got the idea that <xsl:param> can't be a child of <xsl:template>, but that is not so.
-- 
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     Austin, Darrel <Darrel.Austin@xxxxxxxxxxxxxxxxxx>
Sent:     Tue, 28 Nov 2006 13:16:44 -0600
To:       <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject:  RE:  Recursively looping through a template only X number of times?

> You want to use template parameters. Declare xsl:param inside 
> the template, and use xsl:with-param to set a value on the call.

The problem appears to be that xsl:with-param can not be a child of
xsl:template, so I can't call the template recursively while changing
the param value.

> Just have
> <xsl:variable name="tocdepth" select="2"/>
> then wrap your code in
> <xsl:if test="count(ancestor::ruleItem)<=$tocdepth">
> .. make a toc entry...
> </xsl:if>

Of course! Makes perfect sense. That works nicely.

That said, I'm still curious as to how (or if) one can create recursive
logic that can 'count' the recursions via XSL.

-Darrel

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.