Altova Mailing List Archives


Re: [xsl] Re: question on random numbers for browser XSLT

From: Ben Mendis <ben@------------.--->
To: xsl-list@-----.------------.---
Date: 7/24/2009 9:00:00 PM
Vladimir Nesterovsky 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/
>
That's similar to what you would get from random.org. In this case
making a call to random.org is not an option, but there is no reason why
you couldn't add that functionality to the Perl script. And thinking
about it, there's no reason that script has to be Perl. If you want 100%
Pure XSLT it could be an XSLT 2.0 script since it would be executing on
the server, not the client. (Of course, I can't think of a practical
argument for using XSLT 2.0 instead of Perl for this service, other than
to say you did.)
>
>> 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:
>> ...
>> ...
>>     <xsl:choose>
>>       <xsl:when test="function-available('exsl:node-set')">
>>         <xsl:value-of select="document(concat('/cgi-bin/rand.pl?',
> $scale,
>> '&amp;x=', generate-id(exsl:node-set($seed))))" />
>>       </xsl:when>
>>       <xsl:when test="function-available('msxsl:node-set')">
>>         <xsl:value-of select="document(concat('/cgi-bin/rand.pl?',
> $scale,
>> '&amp;x=', generate-id(msxsl:node-set($seed))))" />
>>       </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
>
>
>
>
> --~------------------------------------------------------------------
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: <mailto:xsl-list-unsubscribe@l...>
> --~--
>
>
>

-- 

Ben Mendis
Support Specialist
Antenna House
10410 Kensington Pkwy
Suite 207
Kensington, Maryland 20895
USA
Phone: +1 301-942-4007
Email: ben@a...
Web: www.---.com


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@l...>
--~--

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.