Subject: Re: [xsl] A Counter Variable in XSLT? From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx> Date: 05 Oct 2001 20:25:22 +0100 |
>>>>> "Grant" == Grant Mc Auley <gmcauley@xxxxxxxxxxx> writes: >> You need to unlearn procedural programming! XSLT is a >> declarative, functional language. Grant> I am willing! Just what is meant by "declarative, Grant> functional"? Declarative means that values are declared to be what they are, rather than commanded ("imperative") to take on a value at a particular time. We all learned declarative programming style back when we learned algebra. e.g. the equation y = x + 2 declares y to have a value of two more than the value of x by contrast, the imperative style (which we all had to learn when we took up programming, unlearning the declarative style (why of why isn't functional programming taught first?) looks like this: x = x + 2 which gives the commands to calculate a new value of x, by adding 2 to its existing value. In XSLT, the declarative approach is used: e.g. <xsl:variable name="y" select="$x + 2" /> is the XSLT version of the mathmatical equation. Functional style means functions are first-class objects - that means amongst other things that they can be passed as argumnets to other functions. XSLT 1.0 and XPath 1.0 aren't really functional, but they are declarative. Some of us are hoping for a more functional approach in XPath 2.0. -- Colin Paul Adams Preston Lancashire XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] A Counter Variable in XSL, Grant Mc Auley | Thread | Re: [xsl] A Counter Variable in XSL, Thomas B. Passin |
RE: [xsl] A Counter Variable in XSL, Grant Mc Auley | Date | Re: [xsl] A Counter Variable in XSL, Thomas B. Passin |
Month |