1

我正在 OSB 中运行 xslt 转换。它调用 current-dateTime 方法,如下所示:

<db:lastupdate>
    <xsl:value-of select="fn:current-dateTime()"/>
</db:lastupdate>

它返回以下错误:

<con:fault xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-382513</con:errorCode>
<con:reason>
    OSB Replace action failed updating variable "body": 
    javax.xml.transform.TransformerException: Instance method call 
    to method current-dateTime requires an Object instance as first argument
</con:reason>
...
</con:fault>
4

1 回答 1

3

函数 current-dateTime() 在 XSLT 2.0 中可用,但在 XSLT 1.0 中不可用。所以很有可能当它失败时,您使用的是 XSLT 1.0 处理器。

请注意,在 XSLT 中永远不需要 fn: 前缀。如果出于某种原因你想使用它,你必须声明命名空间——但绝对没有意义。只需编写不带前缀的 current-dateTime() 即可。

于 2014-07-10T19:17:04.083 回答