How can I generate a UUID with pure XSLT? Basically looking for a way to create unique sequences with XSLT. The sequence can be any length.
I'm using XSLT 2.0.
Here's a good example. Basically you set up an extension that points to the java UUID class, and then reference it in the XSL:
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:uuid="java:java.util.UUID">
<xsl:template match="/">
<xsl:variable name="uid" select="uuid:randomUUID()"/>
<xsl:value-of select="$uid"/>
</xsl:template>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With