For randomization in XSLT, you should check out Dimitre Novatchev's excellent
work on FXSL including a whole module for random number generation.
Casting the Dice with FXSL: Random Number Generation Functions in XSLT
http://www.topxml.com/xsl/articles/dice/
-Peter
-----Original Message-----
From: Passin, Tom [mailto:tpassin(_at_)mitretek(_dot_)org]
Sent: Thursday, May 20, 2004 4:05 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] randomizing data
From: SnHndrc(_at_)aol(_dot_)com [mailto:SnHndrc(_at_)aol(_dot_)com]
Is it possible to grab sections of an xml document
<chapter1><title></title><para></para></chapter1> and randomize it with xslt?
Chapter 10 would be first, then 8 then another chapter in random order.
Yes, you could do that. I have a hack in the forthcoming OReilly book "XML
Hacks" that shows a simple way to randomize with xslt. Basically, insert a
string of random numbers into a node in the style sheet and index into it to get
the random numbers. Or you could pass in a different random string as a global
parameter each time you run the stylesheet.
Cheers,
Tom P
--+------------------------------------------------------------------
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(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--