Re: [xsl] Sequential numbers in pure xslt, breaking the no-side-effect rule

Subject: Re: [xsl] Sequential numbers in pure xslt, breaking the no-side-effect rule
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 16 Mar 2007 08:18:52 -0700
Are monads possible in XSLT?

Yes, but the OP requires something very dfferent: a function that has access to no input.

Within a monad there is full visibility to all surrounding context.

It is possible to introudce in XSLT syntatic similar to Haskell's "do
notation", however this is not what the OP asked for.


-- Cheers, Dimitre Novatchev --------------------------------------- Truly great madness cannot be achieved without significant intelligence. --------------------------------------- To invent, you need a good imagination and a pile of junk ------------------------------------- You've achieved success in your field when you don't know whether what you're doing is work or play



On 3/16/07, Nic James Ferrier <nferrier@xxxxxxxxxxxxxxxxxxxx> wrote:
Abel Braaksma <abel.online@xxxxxxxxx> writes:

> AFAIK the answer to this is a simple, short "no, cannot be done". But I
> wanted to check it with the specialists to be sure ;)
>
> The request is simple: create a function that returns '1' on first call,
> and returns one higher each next call, without overlaps or jumps,
> without any input. Let's call it my:seq-number:
>
> <xsl:function name="my:seq-number" as="xs:integer">
>     <!-- some implementation -->
> </xsl:function>
>
> then the following line would return '1 2 3':
> <xsl:value-of select="my:seq-number(), my:seq-number(),
> my:seq-number()" />

Are monads possible in XSLT?


-- Nic Ferrier ---------------------------------------------------------- Need a linux/java/python/web hacker? I'm in need of work! ---------------------------------------------------------- http://www.tapsellferrier.co.uk




--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play

Current Thread