[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: RE: Extending xsltproc?
"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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|