title: How to generate random UUID using xslt
body: <p>I am newbie to xslt. i want to generate 32 digit long UUID using xslt and add it to the xml coming as an input. I tried to use the random function of math liberary but getting error.</p>
  
  <p><strong>Input XML</strong> </p>
  
  <pre><code>&lt;users xmlns="ABC_Login"&gt;
     &lt;email&gt;ABC@gmail.com&lt;/email&gt;
  &lt;/users&gt;
  </code></pre>
  
  <p><strong>XSLT Snippet</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="ABC_Login"  xmlns:math="http://exslt.org/math"
  extension-element-prefixes="math" version="2.0"&gt;
      &lt;xsl:template match="/ns1:users"&gt;
          &lt;users&gt;
              &lt;email&gt;
                  &lt;xsl:value-of select="ns1:email" /&gt;
              &lt;/email&gt;
              &lt;UUID&gt;
                  &lt;xsl:value-of select="(floor(math:random()*10) mod 10) + 1" /&gt;
              &lt;/UUID&gt;
          &lt;/users&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>i am using online editor but getting the exception as below. <a href="http://xslttest.appspot.com/" rel="nofollow">http://xslttest.appspot.com/</a></p>
  
  <p>Error: Cannot find a matching 0-argument function named {<a href="http://exslt.org/math" rel="nofollow">http://exslt.org/math</a>}random(). There is no Saxon extension function with the local name random</p>
  
  <p>Actually i need to generate random token using xslt and add it in the input xml.</p>
  
  <p><strong>Expected Output</strong></p>
  
  <pre><code>&lt;users xmlns="ABC_Login"&gt;
         &lt;email&gt;ABC@gmail.com&lt;/email&gt;
         &lt;uuid&gt;7B81A9B0D9-CA0E-E70F-ADFF-116EE7A1A980&lt;&lt;/uuid&gt;
      &lt;/users&gt;
  </code></pre>
  
  <p>Can anybody help me in this regard. Best Regards,</p>