简体   繁体   English

使用XQSharp引发的异常使用了使用http://exslt.org/dates-and-times的转换

[英]Exception raised using XQSharp with transforms that use http://exslt.org/dates-and-times

We have been using MvpXslTransform to perform transforms on using a relatively complex set of XSLT files. 我们一直在使用MvpXslTransform来执行使用相对复杂的XSLT文件集的转换。 In an attempt to improve the performance of the transforms, I am evaluating the XQSharp library. 为了提高转换的性能,我正在评估XQSharp库。

Unfortunately, when I call ApplyTemplates to perform the transformation, the following exception is raised: 不幸的是,当我调用ApplyTemplates来执行转换时,会引发以下异常:

No implementation was found for extension function 'seconds' in namespace 'http://exslt.org/dates-and-times' with arity 1. 在arity 1的命名空间'http://exslt.org/dates-and-times'中没有找到扩展函数'seconds'的实现。

Can anyone help me to resolve this issue? 任何人都可以帮我解决这个问题吗?

Unfortunately, XQSharp does not natively support the EXSLT functions, which are a set of functions designed to extend XSLT 1.0. 不幸的是,XQSharp本身并不支持EXSLT函数,EXSLT函数是一组旨在扩展XSLT 1.0的函数。 These are not included as they are not standard XSLT functions and have mostly been superceded with XSLT 2.0 这些不包括在内,因为它们不是标准的XSLT功能,并且大多数已经被XSLT 2.0取代

Have a look at the fn:seconds-from-date , fn:seconds-from-dateTime , fn:seconds-from-time , fn:seconds-from-duration , one of which probably does what you want. 看一下fn:seconds-from-datefn:seconds-from-dateTimefn:seconds-from-timefn:seconds-from-duration ,其中一个可能就是你想要的。

Alternatively, it would be easy to implement this function in XPath 2.0 as an xsl:function in your stylesheet. 或者,可以很容易地在XPath 2.0中将此函数实现为样式表中的xsl:function

或者,您可以从Mvp.Xml修改EXSLT的实现 ,并将其包装为XQSharp本机模块

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM