如何显示 SharePoint 为 Web 部件返回的 XML? [英] How to display XML returned by SharePoint for web parts?

查看:50
本文介绍了如何显示 SharePoint 为 Web 部件返回的 XML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我通过修改用于显示各种 Web 部件的 XSL,在 SharePoint 中做了很多自定义样式.了解实际的 XML 是什么样子,包括哪些元素具有实际值,在使用 XSL 时确实很有帮助.我发现了一种在使用 Ontolica Web 部件时显示此 XML 的方法,但在我使用 SharePoint 随附的默认 Web 部件时却没有.

Lately I've been doing a lot of custom styling in SharePoint by modifying the XSL used to display various web parts. Knowing what the actual XML looks like, including which elements have actual values, really helps when working in the XSL. I've discovered a way to show this XML when using Ontolica web parts, but not when I'm using the default web parts included with SharePoint.

那么,有没有办法以编程方式或简单地通过向 URL 添加参数来做到这一点?我真的可以使用这样的工具,如果我能确定它是否可能,我会对开发一个作为 OSS 的工具感兴趣.

So, is there a way to do this, either programmatically or simply by adding a parameter to the URL? I could really use a tool like this and would be interested in developing one as OSS if I could determine if it's possible.

推荐答案

As Ryan 暗示,并非所有(实际上几乎没有)使用 XML/XSLT 来呈现其输出.它是一个完整的组合,包括硬编码、CAML 和 XSLT,具体取决于 Web 部件.因此,您将无法以这种方式可靠地解决问题.

As Ryan has alluded to, not all (in fact hardly any) use XML/XSLT to render their output. It's a complete mix including hard-coding, CAML, as well as XSLT depending on the web part. So you won't be able to reliably approach the problem this way.

但是,Vincent Rothwell 提供了一个名为 ARF 的工具包,其中包含其自己的控件来使用 XML/XSLT 呈现 SharePoint 输出.它是为发布站点而设计的,但声明它也可以在 WSS 下运行.源代码也可用,因此您可以增强现有内容或扩展带有您自己的控件的工具包.我强烈建议您对此进行研究,因为 Vincent 有一个很棒的博客并且似乎了解他的东西.

However there is a toolkit called ARF by Vincent Rothwell which contains its own controls to render SharePoint output using XML/XSLT. It's designed for publishing sites but states that it works under WSS as well. The source code is also available so you can either enhance what's there or extend the toolkit with your own controls. I would strongly recommend researching this as Vincent has a great blog and seems to know his stuff.

这篇关于如何显示 SharePoint 为 Web 部件返回的 XML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆