Pergunta

Então:

Estou tentando usar a função ddwrt:FormatDateTime em uma transformação XSL, mas estou recebendo o seguinte erro:

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

Eu tenho o namespace definido.Aqui está meu cabeçalho (exceto que está tudo em uma linha no meu arquivo):

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

Por que estaria gerando esse erro?Esta é minha primeira transformação XSL.Há algo simples que estou ignorando?

Observação:

Seguir o caminho para o esquema gera uma exceção quando tento navegar até lá no meu navegador...Está apenas para baixo?Existe um novo esquema?

Outras dicas

Não tenho certeza se a webpart do pára-raios suporta as extensões ddwrt.Infelizmente, a MS marcou essa classe como interna, então, quando eu quis usá-la em meu próprio XSLT, tive que refletir o código e colocá-lo em minha própria classe e então registrar minha própria classe como extensão.Duvido que as ferramentas relâmpago tenham feito isso, mas poderiam ter feito.

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);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top