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

Re: Weird variable scoping rules

Subject: Re: Weird variable scoping rules
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Thu, 16 May 2002 00:26:45 +0200
xsl scoping rules
Graham Ashton wrote:
I tried to iterate over the cells and store the number of labels in a
"variable" (i.e. a param), keeping track of the maximum number seen for
any cell, but my attempts to keep track of the maximum value seen so far
aren't working.
You have a wron understanding of XSLT variables and parameters.
Variables aren't actually variable, they can be assigned and
that's it. Parameters are passed to templates or (in case of
global parameters) from the outside into the style sheet.

    <xsl:if test="$vgroup_size > $max_vgroup_size">
      <xsl:param name="max_vgroup_size" select="$vgroup_size"/>

This is actually illegal. Your processor should have raised an error. A xsl:param element must be an immediate child of a xsl:template or xsl:stylesheet, in case of the former it may only be preceeded by other xsl:param elements. You can't use it elsewhere.

How should I be approaching this? Thanks....

This has been rehashed thousands of times here, check the archives. You'll have to use a recursive template, or search for FXML by Dmitre Novatchev (plenty of references in the archive).

J.Pietschmann


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.