SharePoint:呈现而不是下载XML文件 [英] SharePoint: render, rather than download, XML file

查看:120
本文介绍了SharePoint:呈现而不是下载XML文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试将基于XML / XSLT的网站迁移到SharePoint。基本上,现有站点由一堆XML文件组成,每个文件引用(通过xml-stylesheet)一个XSLT文件,该文件将XML转换为完整的HTML文件(包括< html> < head> < body> 等。)。

I'm currently trying to move an XML/XSLT-based website into SharePoint. Basically, the existing site consists of a load of XML files, each of which references (via xml-stylesheet) an XSLT file, which transforms the XML into a full HTML file (including <html>, <head> and <body> etc.).

我现在要做的只是将现有网站转储到SharePoint文档库,让SharePoint控制版本控制,访问权限等,但继续让IE渲染每个XML将文件存入完整的HTML页面。但是,当我尝试查看XML文件时,SharePoint / IE只是尝试下载源代码而不是渲染它。我该如何解决这个问题?

What I'm trying to do at the moment is just to dump the existing site into a SharePoint Document Library, let SharePoint control versioning, access rights etc, but continue to have IE render each XML file into complete HTML pages. However, when I try to view the XML file, SharePoint/IE just tries to download the source, rather than rendering it. How can I fix this?

(此外,任何有关更多SharePointy方式的建议都会受到赞赏。我尝试过使用XML Viewer Web部件但是无法让它正确呈现;将这些XML页面中的每一个都转换为SP Wiki页面可能会很好,但这主要是手工完成的很多工作;页面查看器webpart具有相同的问题,因为它尝试下载文件而不是显示它。)

(Also, any suggestions for a more-SharePointy way of doing this would be appreciated. I've tried using an XML Viewer web part but couldn't get it to render properly; it might be nice to turn each of these XML pages into SP Wiki pages, but that's a lot of work to do essentially by hand; a Page Viewer webpart has the same issue, in that it tries to download the file rather than display it.)

推荐答案

好吧,一些谷歌搜索引导我到以下地方:

Well, some more googling led me to the following:

http://code-journey.com/2011/01/08/sharepoint-2010-download-file-而不是在浏览器中打开-pdf-xml-html-etc-x-download-options-header-trouble /

基本上SharePoint已经它自己的HTTP标头告诉IE8下载文件而不是o写它。不幸的是,它只是一个开/关选项,所以没有选择只为XML文件更改它。

Basically SharePoint has its own HTTP header that tells IE8 to download a file rather than opening it. Unfortunately it's only an on/off option, so there's no choice to only change this for XML files.

但是我是什么最后做的是使用像 stylesheet-in-c-sharp>这个

But what I finally did was to render the XML into HTML on the server, using something like this.

这篇关于SharePoint:呈现而不是下载XML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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