Rank: Newbie
Joined: 11/3/2009 Posts: 1
|
Is it possible to generate a random number in mapforce? I'm generating XSLT 2.0 output and need a unique id/number to be created.
Thanks.
|
Rank: Newbie
Joined: 1/11/2007 Posts: 6 Location: Germany
|
Hello,
if it just had to be unique, look at "create-guid" from the generator functions.
Regards,
rauger
|
Rank: Advanced Member
Joined: 7/17/2008 Posts: 185 Location: Minutiae, Triviality
|
the requirement was "xslt2" which doesn't supply a random number concept so no create-guid.
You can use a rather slow algorithm based on date-time functions, string manipulation, etc, but you can't guarantee that you will get a unique value probably.
generate-id will return a unique value based on the instance file, which may be sufficient, but if you need something approaching "globally unique" that isn't something xslt is prepared to offer you.
Extension functions might work, if you want to write your random id generator in java or c# or something.
|