SO:

我正在尝试使用ddwrt:formatdatetime函数在xsl转换中,但我收到以下错误:

Exception details:
Method: System.Collections.Generic.IList`1[System.Xml.XPath.XPathItem]
InvokeXsltLateBoundFunction(System.String, System.String,
System.Collections.Generic.IList`1[System.Xml.XPath.XPathItem][])
Type: System.Xml.Xsl.XslTransformException
Source: System.Data.SqlXml
Description: Cannot find the script or external object that implements prefix 
'http://schemas.microsoft.com/WebParts/v2/DataView/runtime'.
.

我确实定义了命名空间。这是我的标题(除了我的文件中的一行):

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
.

为什么它会抛出这个错误?这是我的第一个XSL变换。有什么简单的我忽略了吗?

注意: 在架构跟踪路径后,当我尝试从我的浏览器导航时抛出异常......它只是下降吗?有新的架构吗?

其他提示

我不确定闪电指挥webpart支持ddwrt扩展。不幸的是,MS标记为内部的类,所以,当我想在我自己的XSLT中使用它们时,我必须反射代码并将其放入自己的类中,然后将自己的类注册为扩展名。我怀疑闪电工具这样做,但它们可能有。

XsltArgumentList xslArgs = new XsltArgumentList();
DdwRuntime runtime = new DdwRuntime();  //My own class reflectored from SharePoint
runtime.View = view;
runtime.List = list;
runtime.Web = web;
runtime.ListItem = listItem;
xslArgs.AddExtensionObject("http://schemas.microsoft.com/WebParts/v2/DataView/runtime", runtime);
.

许可以下: CC-BY-SA归因
scroll top