Calling Java Methods in XSLT

送分小仙女□ 提交于 2019-12-24 02:05:48

问题


Trying to generat a random number with the help of Java UUID class.

<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>

Error

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

回答1:


See http://saxonica.com/documentation/index.html#!extensibility, if you want to use Saxon 9 and have that feature (called reflexive extension functions) you need a license for PE or EE.



来源:https://stackoverflow.com/questions/19004719/calling-java-methods-in-xslt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!