尝试借助Java UUID类生成随机数。

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
  exclude-result-prefixes="xs" xmlns:uuid="java:java.util.UUID">
<xsl:template match="/">
<xsl:variable name="uid" select="uuid:randomUUID()"/>
<ClientPK><xsl:value-of select="$uid"/></ClientPK>

错误
Cannot find a matching 0-argument function named {java:java.util.UUID}randomUUID().
  Note that direct calls to Java methods are not available under Saxon-HE

最佳答案

请参阅http://saxonica.com/documentation/index.html#!extensibility,如果要使用Saxon 9并具有该功能(称为自反扩展功能),则需要PE或EE的许可证。

10-02 10:32
查看更多