473,574 Members | 2,914 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Firefox and XSLT (local stylesheet works, server-based stylesheet fails)

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.co m/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.c om) is behind a firewall so you
won't be able to access it.
Aug 11 '05 #1
14 24210
David Blickstein wrote:
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.co m/db/makehtml.xslt" version="1.0"?>

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


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
Aug 11 '05 #2

"miseryman" <mi**********@y ahoo.com> wrote in message
news:MP******** *************** *@news.telenet. be...
David Blickstein wrote:
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.co m/db/makehtml.xslt" version="1.0"?>

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


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


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.co m/db/makehtml.xslt" version="1.0"?>
<IRDump xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespace SchemaLocation= "girml2.xsd " >

Here's the header for the XSLT stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et 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
Aug 11 '05 #3


David Blickstein wrote:

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.co m/db/makehtml.xslt" version="1.0"?>


As a security measure you can only apply stylesheets from the same
origin the XML is loaded from so Firefox will certainly load that
stylesheet if your XML with the <?xml-stylesheet?> is located too on
that server dregs.zko.hp.co m.
But with normal security settings for IE and the internet zone that is
not different if you load an XML document via http.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 11 '05 #4


David Blickstein wrote:

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.


That means that the file is served with a MIME type that Firefox does
not know to handle. You have to set up your server to serve that file as
text/xml or application/xml. If you can't change the server settings
then rename the file makehtml.xml and your server will probably serve it
with an XML MIME type like application/xml or text/xml.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 11 '05 #5
> That means that the file is served with a MIME type that Firefox does
not know to handle. You have to set up your server to serve that file as
text/xml or application/xml. If you can't change the server settings
then rename the file makehtml.xml and your server will probably serve it
with an XML MIME type like application/xml or text/xml.


Renaming the stylesheet with a .xml extension and changing the href to
reflect that in the xml-stylesheet tag solved the problem of not being able
to view the stylesheet with Firefox, but I still can't load/translate the
file I want the stylesheet applied to. I still end up with a blank screen
when the href is to a URL rather than a local file.

I've verified that the URL is correctly typed (by cutting and pasting it
into Firefox).

FWIW, Internet Explorer still works both ways. The problem is definitely
specific to Firefox.

Any further suggestions?

Thanks
Aug 11 '05 #6
I made another experiment of relevance here and have come to the following
conclusions:

1) Internet Explorer is happy with either .xslt or .xsl but Firefox is only
happy with .xsl

2) The remaining problem is indeed that Firefox will not load a stylesheet
from a separate location than the source file referring to it. That pretty
much kills me and it doesn't seem like there are any user options to change
that.

Thanks for all the help.
Aug 11 '05 #7
On Thu, 11 Aug 2005, David Blickstein wrote:

[I'm adding a comment here from the sidelines, without having followed
this thread in every detail. Use this comment or not, as you wish...]
I made another experiment of relevance here and have come to the
following conclusions:

1) Internet Explorer is happy with either .xslt or .xsl
IE deliberately violates a mandatory requirement of the HTTP RFC,
RFC2616 (and documents this violation, without actually admitting it
for what it is), that in an HTTP transaction the only feature of
relevance is the MIME content-type sent by the server. Filename
extensions are of *no concern whatever* to a web-compatible client
agent, in an HTTP transaction.
but Firefox is only happy with .xsl


I presume that Firefox conforms to RFC2616 at least as well as does
Mozilla, with which I'm familiar. In an HTTP transaction, it
considers solely and exclusively the MIME content-type from the
server: filename extensions are not permitted to be of the slightest
concern to it. This is fundamental to the HTTP protocol rules.

(Processing of locally-stored files would of course be a different
matter).

Corollary: the behaviour of MSIE can never be taken to be any
indication of correctness. If it does what the author intended, in a
situation where a web-compatible browser does otherwise, then in many
cases that's because both the author and MSIE are wrong.

best regards
Aug 11 '05 #8
> > 1) Internet Explorer is happy with either .xslt or .xsl

IE deliberately violates a mandatory requirement of the HTTP RFC,
RFC2616 (and documents this violation, without actually admitting it
for what it is), that in an HTTP transaction the only feature of
relevance is the MIME content-type sent by the server. Filename
extensions are of *no concern whatever* to a web-compatible client
agent, in an HTTP transaction.
but Firefox is only happy with .xsl


I presume that Firefox conforms to RFC2616 at least as well as does
Mozilla, with which I'm familiar. In an HTTP transaction, it
considers solely and exclusively the MIME content-type from the
server: filename extensions are not permitted to be of the slightest
concern to it.


I'm also just responding via a cursory reading of what you wrote but... I
guess I don't understand why you're pointing the finger at IE rather than
Firefox. Tell me where I went wrong in the following logic:

1) You say the "file exts are of no concern whatever to a web compatible
client"
2) I've told you that IE doesn't care what the extension is, it works with
either
extension
3) I've told you that Firefox fails with one file extension and works with
another
4) I conclude that Firefox is the one that is "concerned" with file
extensions
not IE.
5) This is a Firefox bug, not an IE bug???
Aug 11 '05 #9
On Thu, 11 Aug 2005, David Blickstein wrote:
3) I've told you that Firefox fails with one file extension and
works with another
If we're talking about HTTP transactions as I has assumed, this
indicates that your HTTP server is sending different MIME content
types for these different filename extensions. The MIME content types
are the sole desiderata at the interworking interface - and hence are
what an adviser would need to know in order to help you further; the
filename extension is of no concern to a web-compatible client agent -
any effect that it's having is purely internal to your web server.

Could I suggest that you install Chris Pederick's "web developer
extension" for easy access to diagnostic information?
http://chrispederick.com/work/firefox/webdeveloper/

Under its (i)nformation menu, one can call up the "view response
headers" option, which shows clearly what the HTTP transaction
returned in the way of MIME content-type and related information.
This is the key to the behaviour of web-compatible client agents
(from which MSIE deliberately excludes itself, as already noted).
4) I conclude that Firefox is the one that is "concerned" with file
extensions
Not so. The effect is entirely shielded from any web-compatible
client agent (which in this instance means RFC2616-conforming), by
your web *server*. What it's responding to is the MIME type returned
by your server.

(You've already been told by another that it's a MIME-type issue, but
you're apparently chosen to disregard that).
5) This is a Firefox bug,
I can't agree. On the evidence, Firefox is behaving impeccably.
not an IE bug???


IE's deliberate misbehaviour vis a vis RFC2616 is too crass to be
rated as a mere "bug".

best regards
Aug 11 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1417
by: Jørn Tommy Kinderås | last post by:
Jeg skal ha en referanse til et stylesheet(xsl) i en xml fil, altså: <?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?> Problemet er at xml fila genereres av en annen xsl fil. Hvordan setter man inn et stylesheet referanse i en xml fil ved hjelp av xsl blir da spørsmålet..jeg får bare feilmelding på "?". Jørn T
1
1648
by: Steven An | last post by:
I'm gonna describe the situation I'm dealing with..but if you're not interested, just skip to the last line where I bluntly ask my question :) Here's my scenario: I've got a huge website that has many pages. Each page has its own content (which changes often). So I wanna use XSLT stylesheets to create these pages (so I can modify the...
3
2109
by: Jim Davis | last post by:
The scenario: 1) Generate a popup window via script. 2) Populate it (again via script) with content that features local (hash) links. In IE 6.x this works - the links work as they should, moving the document to that document position. However in FireFox 1.x the links load the main page (the opener) in to the popup. Both browsers...
23
3637
by: AJBopp | last post by:
Ok, I'm trying to be a good little boy and create a site that doesn't use frames :) Things were going along decently until I uploaded what little I have done so far to the web server (that is, things were displaying pretty well on my local machine - not perfect, but we'll get to that later). So here's the site:...
7
2232
by: shaun roe | last post by:
Hi, I am using an XSLT to generate an SVG client-side in Firefox. The user opens an XML file in Firefox and sees a display. In doing so, I have to convert from cartesian to polar coordinates, so I need the sine and cosine functions. Firefox does not seem to recognize the math: extensions (not too surprising) so I am using a series...
2
6320
by: Frobinrobin | last post by:
Hi all, I have this irritating problem. I cannot use tables and I need to format text in columns. I decided that DIV would serve the purpose and set about learning a few properties for them. When I apply properties to the DIV tag direct, the display is correct. When I use a CSS stylesheet, the display is incorrect. Please can
6
6253
by: chris.rapking | last post by:
This seemingly happened overnight. http://www.chrisrapking.com The styles that are inline work fine. Anything in the head does not (which, if you notice, includes some styling information plus a link to an external sheet named rapking.css) Any thoughts?
0
7805
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7726
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7817
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5301
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3752
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2245
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1060
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.