Is a way to generate random number using XSLT 1.0

I'm trying to generate random number using XSLT 1.0 (in Teamsite). Every time I generate a page a new random number should be generated as well.

Answers


Here is the solution:

Teamsite XSLT uses xalan-j processor, it allows you to use Java library functions and below code will helps you creating random number everytime you generate a page.

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" exclude-result-prefixes="xalan math"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:xalan="http://xml.apache.org/xalan"
                  xmlns:math="xalan://java.lang.Math">
       <xsl:template match="/">
           <xsl:value-of select="math:random()"/>
        </xsl:template>

    </xsl:stylesheet>

Need Your Help

Thread safe locale techniques

python multithreading locale

We're currently writing a web application based on a threaded python web server framework (cherrypy) and would like to simultaneously support users from multiple locales.

Referencing the value of a variable in Fitnesse by using another variable value

variables fitnesse

Is it possible to re-use a variable in Fitnesse in referencing another variable:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.