xs:date function is not defined in xslt2.0

huangapple go评论94阅读模式
英文:

xs:date function is not defined in xslt2.0

问题

我目前在BPEL过程中遇到了XSLT转换的问题。在我的XSLT文件中,我使用了xs:date函数将一个字符串转换为日期格式。然而,当我运行BPEL处理时,出现了以下错误:

“XPath表达式无法执行;原因是:javax.xml.transform.TransformerConfigurationException: oracle.xml.xpath.XPathException: 在命名空间http://www.w3.org/2001/XMLSchema下未定义日期函数。
请检查异常消息文本中描述的详细根本原因,并验证XPath查询是否正确。”

更多信息:

我使用了样式表版本2.0

我已经声明了命名空间xs。

我还尝试使用了xs:dateTime…

有人知道问题是什么吗?

非常感谢。

英文:

I'm currently having problem with xslt transform in bpel process. In my xslt file, I used xs:date function to convert a string to date format. However, when I run the bpel processed, the following error returned:

"The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerConfigurationException: oracle.xml.xpath.XPathException: date function under namespace http://www.w3.org/2001/XMLSchema is not defined.
Check the detailed root cause described in the exception message text and verify that the XPath query is correct. ".

More Info:

I used stylesheet version 2.0

I declared the namespace xs already.

I also tried to used xs:dateTime...

Does anyone know what is the problem?

Thank you so much.

答案1

得分: 1

你需要使用支持XSLT 2.0的XSLT处理器。如果你的XSLT处理器只识别version="1.0",那么在样式表上指定version="2.0"是没有帮助的。虽然2.0版本在2007年发布,但仍然有许多处理器(如Java、.NET和浏览器中的默认处理器)没有进行更新。

异常"oracle.xml.xpath.XPathException"表明你可能正在使用Oracle XDK中的XSLT处理器。根据我的记忆,这个处理器在某种程度上更新到了XSLT 2.0,但由于Oracle收购Sun,升级工作从未完成,因此它支持一些XSLT 2.0的特性,但并非全部。

英文:

You need to use an XSLT processor that supports XSLT 2.0. Specifying version="2.0" on the stylesheet isn't going to help if your XSLT processor only recognizes version="1.0". Although 2.0 came out in 2007, there are many processors (such as the default processors in Java, .NET, and in browsers) that still haven't been updated.

The exception oracle.xml.xpath.XPathException suggests to me that you are probably using the XSLT processor in the Oracle XDK. This has a somewhat peculiar status, IIRC, in that it was partially updated towards XSLT 2.0 but (because of Oracle's acquisition of Sun) the upgrade was never finished, so it supports some XSLT 2.0 features but not all.

huangapple
  • 本文由 发表于 2020年1月6日 21:50:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/59613301.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定