[xml] EXSLT random() function

Should I expect the results of the EXSLT random() function to be different for each invocation? I transform an XML file with an identity transform, changing it only by adding an attribute @tyche with the value of the EXSLT random function. For a given input file and a given stylesheet, the output of all transformations are identical. Is this expected? My hope was to use random() to make a random selection of elements from a document, such that each time I made the selection I would get a different selection.

I'm posting sample input, stylesheet, and output files at
'randomize.xsl' is the stylesheet. 'modules.xml' is the input. 'one' and 'two' are the output from two invocations of the transformation as 'xsltproc randomize.xsl modules.xml'.

$ xsltproc --version
Using libxml 20627, libxslt 10120 and libexslt 813
xsltproc was compiled against libxml 20627, libxslt 10120 and libexslt 813
libxslt 10120 was compiled against libxml 20627
libexslt 813 was compiled against libxml 20627

Thanks for your help.
Chuck Bearden (cbearden rice edu ; 713.348.3661)
XML Engineer, Connexions

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]