This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: A little Divinitation with generate-id()?
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: A little Divinitation with generate-id()?
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Fri, 12 May 2000 09:58:55 +0100
- Reply-To: xsl-list at mulberrytech dot com
> Assuming I have 8 possible outcomes, I would want to randomly
> call one of them
>
> Of course, I suppose, generate-id() is the ideal way to go,
Absolutely not. There is no guarantee at all that the identifiers generated
by generate-id() have any useful randomness propoerties. For example, they
could all end in "0" - it's entirely up to the implementer. In Saxon, id's
ending in "1" are much more likely than any other value.
If you don't care about good randomness, you could use "string-length(/) mod
8", but really I think you need an external function here.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list