Firefox和XSLT(本地样式表工作,基于服务器的样式表失败) [英] Firefox and XSLT (local stylesheet works, server-based stylesheet fails)

查看:80
本文介绍了Firefox和XSLT(本地样式表工作,基于服务器的样式表失败)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些XML文档,我想在网络浏览器中打开,并通过XSLT自动翻译成HTML。我正在一个名为girml.xml的文件中使用xml-stylesheet

处理命令。


这一切都适用于Internet Explorer,但是不适用于Firefox。


在IE和Firefox中都可以使用:


<?xml-stylesheet type ="文本/ XSL"编码= QUOT; UTF-8英寸href =" makehtml.xslt"

version =" 1.0"?>


以下适用于IE并且使用Firefox失败(服务器)是WindowsXP

btw):


<?xml-stylesheet type =" text / xsl" encoding =" UTF-8"

href =" http://dregs.zko.hp.com/db/makehtml.xslt" version =" 1.0"?>


区别在于样式表是来自服务器还是来自

本地文件。


另一个有趣的数据点是我得到不同的结果取决于

我是否尝试打开girml.xml作为本地文件(打开文件)或作为

网络服务文件(打开位置)。当我在本地打开它时,我只得到一个

的空白屏幕。当我尝试从服务器打开它时,我得到:


加载样式表时出错:(null)"
http://dregs.zko.hp.com/db/makehtml.xslt


我可以使用IE从该URL加载样式表。当我尝试使用

Firefox加载它时,它会询问我要用什么程序来打开它。但显然

文件就在那里,并且可以访问。


谢谢,


Dave Blickstein


ps不幸的是,我的服务器(dregs.zko.hp.com)位于防火墙后面,因此你无法访问

I have some XML documents that I want to open in a web browser and be
automatically translated to HTML via XSLT. I''m using an xml-stylesheet
processing command in a file called "girml.xml".

This all works in Internet Explorer, but doesn''t work with Firefox.

In both IE and Firefox this works:

<?xml-stylesheet type="text/xsl" encoding="UTF-8" href="makehtml.xslt"
version="1.0"?>

The following works with IE and fails with Firefox (the server is WindowsXP
btw):

<?xml-stylesheet type="text/xsl" encoding="UTF-8"
href="http://dregs.zko.hp.com/db/makehtml.xslt" version="1.0"?>

The difference is whether or not the stylesheet comes from a server or a
local file.

Another interesting datapoint is that I get different results depending on
whether I try to open girml.xml as a local file ("Open File") or as a
web-served file ("Open Location"). When I open it locally I just get a
blank screen. When I try to open it from the server, I get:

"Error loading stylesheet: (null)"
http://dregs.zko.hp.com/db/makehtml.xslt

I can load the stylesheet from that URL with IE. When I try to load it with
Firefox it asks me what program I want to use to open it. But clearly the
file is there, and accessible.

Thanks,

Dave Blickstein

p.s. Unfortunately, my server (dregs.zko.hp.com) is behind a firewall so you
won''t be able to access it.

推荐答案

David Blickstein写道:
David Blickstein wrote:
以下适用于IE并且使用Firefox失败(服务器是WindowsXP
btw):

<?xml-stylesheet type =" text / xsl" encoding =" UTF-8"
href =" http://dregs.zko.hp.com/db/makehtml.xslt" version =" 1.0"?>

区别在于样式表是来自服务器还是来自本地文件。
The following works with IE and fails with Firefox (the server is WindowsXP
btw):

<?xml-stylesheet type="text/xsl" encoding="UTF-8"
href="http://dregs.zko.hp.com/db/makehtml.xslt" version="1.0"?>

The difference is whether or not the stylesheet comes from a server or a
local file.



这可能是由于MIME类型问题造成的。请看一下Mozilla XSLT FAQ中的第一个问题:

< http://www.mozilla.org/projects/xslt/faq.html>。br />

-

Raf



This is probably due to a MIME type issue. Look at the
first question in the Mozilla XSLT FAQ:
<http://www.mozilla.org/projects/xslt/faq.html>.

--
Raf




" miseryman" < MI ********** @ yahoo.com>在留言中写道

新闻:MP ************************ @ news.telenet.be ...

"miseryman" <mi**********@yahoo.com> wrote in message
news:MP************************@news.telenet.be...
David Blickstein写道:
David Blickstein wrote:
以下适用于IE并且使用Firefox失败(服务器是
WindowsXP btw):

<?xml-stylesheet type =" text / xsl" encoding =" UTF-8"
href =" http://dregs.zko.hp.com/db/makehtml.xslt" version =" 1.0"?>

区别在于样式表是来自服务器还是来自本地文件。
The following works with IE and fails with Firefox (the server is WindowsXP btw):

<?xml-stylesheet type="text/xsl" encoding="UTF-8"
href="http://dregs.zko.hp.com/db/makehtml.xslt" version="1.0"?>

The difference is whether or not the stylesheet comes from a server or a
local file.


这可能是由于MIME类型问题。请看Mozilla XSLT FAQ中的第一个问题:
< http://www.mozilla.org/projects/xslt/faq.html>。

-
Raf



This is probably due to a MIME type issue. Look at the
first question in the Mozilla XSLT FAQ:
<http://www.mozilla.org/projects/xslt/faq.html>.

--
Raf




我不清楚如何纠正这个问题。


这是' XML文件的标题:


<?xml version =" 1.0" encoding =" UTF-8"?>

<?xml-stylesheet encoding =" UTF-8" type =" text / xsl"

href =" http://dregs.zko.hp.com/db/makehtml.xslt" version =" 1.0"?>

< IRDump xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation =" girml2.xsd" >


这里是XSLT样式表的标题:

<?xml version =" 1.0" encoding =" UTF-8"?>

< xsl:stylesheet version =" 1.0"

xmlns:xsl =" http:// www .w3.org / 1999 / XSL / Transform"

xmlns:xs =" http://www.w3.org/2001/XMLSchema">


我需要添加一些内容。


我无法让Firefox报告MIME类型,因为它似乎坚持使用

使用一些其他程序来查看XSLT样式表。 IE似乎将它报告为

为type:XSL Transformation。


有没有人有一个两个头文件(XML和XSLT)的例子可以使用

Firefox?


再次感谢,


db



I''m unclear as to how to correct this.

Here''s the header for the XML file:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet encoding="UTF-8" type="text/xsl"
href="http://dregs.zko.hp.com/db/makehtml.xslt" version="1.0"?>
<IRDump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="girml2.xsd" >

Here''s the header for the XSLT stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema">

Is there something I need to add.

I can''t get Firefox to report the MIME type because it seems to insist on
using some OTHER program to view the XSLT stylesheet. IE seems to report it
as "type: XSL Transformation".

Does anyone have an example of two headers (XML and XSLT) that work with
Firefox?

Thanks again,

db





David Blickstein写道:



David Blickstein wrote:

以下适用于IE并且使用Firefox失败(服务器是WindowsXP
顺便说一句:

<?xml-stylesheet type =" text / xsl" encoding =" UTF-8"
href =" http://dregs.zko.hp.com/db/makehtml.xslt" version =" 1.0"?>
The following works with IE and fails with Firefox (the server is WindowsXP
btw):

<?xml-stylesheet type="text/xsl" encoding="UTF-8"
href="http://dregs.zko.hp.com/db/makehtml.xslt" version="1.0"?>




作为安全措施,您只能应用来自相同的

来源的样式表XML如果您的XML带有<?xml-stylesheet?>,那么Firefox肯定会加载那个

样式表。也位于

服务器dregs.zko.hp.com。

但是IE和互联网区域的正常安全设置是
$ b $如果您通过http加载XML文档,则没有什么不同。


-


Martin Honnen
http://JavaScript.FAQTs.com/


这篇关于Firefox和XSLT(本地样式表工作,基于服务器的样式表失败)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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