user1802439
user1802439

Reputation: 2891

xslt current-dateTime error

I'm running an xslt transformation in OSB. It invokes the current-dateTime method as follows:

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

It returns the following error:

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

Upvotes: 1

Views: 1445

Answers (1)

Michael Kay
Michael Kay

Reputation: 163458

The function current-dateTime() is available in XSLT 2.0 but not in XSLT 1.0. So the chances are that when it failed, you were using an XSLT 1.0 processor.

Note that the fn: prefix is never needed in XSLT. If for some reason you want to use it, you must declare the namespace - but there is absolutely no point. Just write current-dateTime() without the prefix.

Upvotes: 3

Related Questions