This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: RE: Extending xsltproc?
- From: Dimitre Novatchev <dnovatchev at yahoo dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 25 Apr 2002 10:17:06 -0700 (PDT)
- Subject: [xsl] Re: RE: Extending xsltproc?
- Reply-to: xsl-list at lists dot mulberrytech dot com
"Michael Kay" <michael dot h dot kay at ntlworld dot com> wrote:
> > and I'd also like to be able to present
> > a node-set in a new random order on each call.
>
> There's no random() function in XSLT, but you can pass a random
> number into the stylesheet as a parameter and use it to pseudo-
> randomize the output order, e.g. by doing
>
> <xsl:sort select="translate(generate-id(), "1234567890", string
> ($random))"
Seems an interesting idea, but this will most probably not change the
document order of the nodes in a nodeset, in case generate-id() returns
something like:
"IDAFAYHC"
which is what MSXML3 gives me. What if in the next version they change
the way they calculate the result of generate-id()?
Not to speak that someone could need to have more than one random
(dynamically determined number of) orderings of a node-set during the
same transformation.
Cheers,
Dimitre Novatchev.
__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list