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

Re: XSL hold, compare, and replace param value

Subject: Re: XSL hold, compare, and replace param value
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 14 Jul 2006 17:05:44 +0100
temporary values in xslt
Others have given solutions but let me just observe (given a recent
thread about mutable variables) that the solutions follow the natural
human language description rather than a solution that you'd program in
an imperative programming language.

If you were describing the problem to a person you'd say that you want
to group the items by country and put a country heading at the top of
each group.

You wouldn't (or at least I wouldn't) introduce the notion of state and
some temporary variable holding the last seen country and say that for
each item you need to compare the current country with the value of the
variable stored at the last item.

The human-oriented description does not introduce any variables at all,
and the XSLT solutions typically don't use any variables either.
This is almost always the case when someone more familiar with
imperative programming languages has problems with the fact that xsl
variables "don't change". Usually it's not that you don't need to change
the value of a variable, it's that you don't need a variable at all.


Current Thread


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.
First Name
Last Name
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.