This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: xsl:variable {RE: XSL to handle display mutiple pages}


Thanks for the clarafication :)

This is related to the pagination problem I had earlier.  Since my first
page has header, it can only contain 50 lines, while the latter page can
contain 60 lines.  So I want to set $maxItemsPage to be 50 for the first
page, and 60 for the following pages.

What is the easier way to achieve this?

Much thanks,
Xiaocun

-----Original Message-----
From: Mike Brown
To: xsl-list@mulberrytech.com
Sent: 11/7/00 7:08 PM
Subject: Re: xsl:variable {RE: XSL to handle display mutiple pages}

Xu, Xiaocun wrote:
> 	I read in the book that once set, xsl:variable is non-changable.

Correct, for as long as the variable is in scope. When/where the
variable
goes out of scope, you can assign it to something else.

> How do I have a changable variable, xsl:param?

No, xsl:param lets you assign a default value. It is usually used in
conjuction with xsl:with-param to pass a value to a template where the
variable would have otherwise been out of scope.

Understand that a variable is a *name* assigned to an *object* of one of
the basic types: boolean, number, string, node-set, result tree
fragment.
When we talk about a variable's "value" we usually mean the object,
because a variable's "string-value" is the object's string-value, and is
a
distinct concept.

xsl:variable or xsl:param just provide ways to bind a name to an object.
Once such a binding is made, you cannot bind the variable to another
name.

What is it you are trying to do? Chances are, you are trying to do
procedural programming in a functional, declarative language, and
there's
another way to accomplish the same result that doesn't rely on variable
rebinding.

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at         My XML/XSL resources:
webb.net in Denver, Colorado, USA           http://www.skew.org/xml/


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


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]