[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: A Counter Variable in XSLT?
>>>>> "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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|