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

Re: Re: question on random numbers for browser XSLT

Subject: Re: Re: question on random numbers for browser XSLT
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 24 Jul 2009 14:00:47 -0700
Re:  Re: question on random numbers for browser XSLT
> If you have decided to go with a service providing random numbers then
> xslt-ish way (set based) to do it would be a service receiving a number and
> returning an xml with a specified number of random numbers.
>

Using a service to provide a random sequence is much more unreliable
and inefficient than just doing this in pure XSLT, as this has been
done by FXSL for many years:

   http://fxsl.sourceforge.net/articles/Random/Casting%20the%20Dice%20with%20
FXSL-htm.htm


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



On Fri, Jul 24, 2009 at 1:48 PM, Vladimir
Nesterovsky<vladimir@xxxxxxxxxxxxxxxxxxxx> wrote:
> If you have decided to go with a service providing random numbers then
> xslt-ish way (set based) to do it would be a service receiving a number and
> returning an xml with a specified number of random numbers.
> --
> Vladimir Nesterovsky
> http://www.nesterovsky-bros.com/
>
>
>> To Ben:
>> The cache-append idea was my first thought, but I couldn't think of a
>
> good
>>
>> way to pull together how to have each request be unique. It's possible
>> using node-set(), though:
>> ...
>> ...
>> B  B <xsl:choose>
>> B  B  B <xsl:when test="function-available('exsl:node-set')">
>> B  B  B  B <xsl:value-of select="document(concat('/cgi-bin/rand.pl?',
>
> $scale,
>>
>> '&amp;x=', generate-id(exsl:node-set($seed))))" />
>> B  B  B </xsl:when>
>> B  B  B <xsl:when test="function-available('msxsl:node-set')">
>> B  B  B  B <xsl:value-of select="document(concat('/cgi-bin/rand.pl?',
>
> $scale,
>>
>> '&amp;x=', generate-id(msxsl:node-set($seed))))" />
>> B  B  B </xsl:when>
>> ...
>
> I tried your solution and after replacing '&amp;x=' with '+' it directly
> worked on my local web server!
> (I did not know that generate-id works in a browser)
>
> But as already posted it did not work after installed on my real webserver
> because that does not have enough power to handle the six document opens.
>
> Btw, I really like the solution of David Carlisle to provide exslt:node-set
> for IE browsers (and not having to deal with exslt/msxml):
> http://dpcarlisle.blogspot.com/2007/05/exslt-node-set-function.html

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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-2007 All Rights Reserved.