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

Re: RE: Extending xsltproc?

Subject: Re: RE: Extending xsltproc?
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 25 Apr 2002 10:17:06 -0700 (PDT)
generate id random order
"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


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-2013 All Rights Reserved.