Hello everyone. I'm new to this forum, and hoping someone might be able to shed some light on a difficult problem I'm having.
What I am trying to do is possible. I have created an EAD (an XML schema) file that connects to an XSL stylesheet, yet it loads only with Firefox, and no other browser (that i've tried). A great example of what I am trying to accomplish--an EAD/XML file connecting to a XLS stylesheet that works across multiple browsers--is: http://www.mnhs.org/library/findaids/sv000039.xml.
My XSL and XML code are valid (confirmed by Altova's XMLSpy software), and I would prefer not to have to convert the XML/XSL into an HTML file.
I am attempting to do this for my master's thesis, so any help would be greatly appreciated. My EAD/XML file, which connects to the XLS stylesheet can be found here.
Location: Splendora, Texas, United States of America
Posts: 2,895
Thanks: 5
Thanked 187 Times in 184 Posts
Quote:
Originally Posted by apinrise
yet it loads only with Firefox
Your document seems to work fine for me in Chrome 22 (Dev Channel), Firefox 15 (Aurora), Internet Explorer 9, Opera 12.5 (Opera Next), and Safari 5.1. Three of those are alpha versions of the browsers though. The only browser I have that it doesn't work in is the dinosaur-like Konqueror 4.8.
There are minor stylistic differences between the browsers, however. For example, in Internet Explorer, text shadows are missing, and Firefox presents the unittitle element text in a much heavier font than the other browsers.
__________________
Please for the love of god stop making IE. You current "browser"s cause me to cry every day. —Phil *
This document appears to work correctly in Firefox 15 (Aurora) and Opera 12.5 (Opera Next) although the presentation varies between them slightly. (In Opera, the search button wraps to the next line, the logo is blue, and most text is shown in serif fonts. In Firefox, text is overflowing the gold box at the top of the page, the logo is green, and all text is shown in sans-serif fonts.)
Internet Explorer 9 is displaying your page, but in quirks mode. This is presumably because no document type declaration is specified in your XSLT style sheet. Presentational differences from the above include a red logo, left-aligned layout, and a left-aligned, floating image.
Chrome 22 (Dev Channel) and Safari 5.1 are not displaying anything at all. Chrome shows warnings about your two XSLT style sheets being served with the deprecated text/xml MIME type. Your XML document is also being served with that MIME type, but no warnings are shown. In contrast, your sv000039.xml file and its XSLT style sheets are being served with the non-deprecated application/xml MIME type. Chrome also reports a 404 Not Found error for your ead.dtd file. My guess is that the problem involves the MIME type issue.
And, of course, the page again displays as a blob of text (again) in Konqueror 4.8.
__________________
Please for the love of god stop making IE. You current "browser"s cause me to cry every day. —Phil *
Last edited by Arbitrator; 07-12-2012 at 08:22 AM..
Reason: I added the last sentence in the third paragraph.
Internet Explorer 9 is displaying your page, but in quirks mode. This is presumably because no document type declaration is specified in your XSLT style sheet.
Okay, but I noticed that the working example I provided also has no declaration specified in its XSLT style sheet. Or am I missing something?
Quote:
Originally Posted by Arbitrator
Chrome shows warnings about your two XSLT style sheets being served with the deprecated text/xml MIME type. Your XML document is also being served with that MIME type, but no warnings are shown. In contrast, your sv000039.xml file and its XSLT style sheets are being served with the non-deprecated application/xml MIME type. Chrome also reports a 404 Not Found error for your ead.dtd file. My guess is that the problem involves the MIME type issue.
From my examination of the sv000038.xml code, their MIME type is text/xsl, not application/xml. Or, again, am I overlooking something obvious.
Okay, so uploading the ead.dtd file to the same directory as my XML and XSL files--along with changing the mime type to text/xsl--seems to have done the trick. I can now access the site through Chrome, Safari and Firefox. I don't have access to IE, however.
Location: Splendora, Texas, United States of America
Posts: 2,895
Thanks: 5
Thanked 187 Times in 184 Posts
Quote:
Originally Posted by apinrise
Okay, but I noticed that the working example I provided also has no declaration specified in its XSLT style sheet. Or am I missing something?
sv000039.xml is also displaying in quirks mode in Internet Explorer 9. I am not seeing the same seemingly-quirks-mode-related problems with this page, but I would still try to get that problem fixed if possible. You can confirm that quirks mode is in use by invoking the F12 Developer Tools (by pressing F12) in Internet Explorer 9 and reading the information at the top of the pane that appears (where it says "Document Mode:").
From my examination of the sv000038.xml code, their MIME type is text/xsl, not application/xml. Or, again, am I overlooking something obvious.
I rechecked this and you are partially correct. sv000038.xml is displaying using the MIME type text/xsl according to Firefox's View Page Info dialog box and application/xml according to Opera's Page Information pane. Both browsers are indicating that your XSLT style sheet is using the MIME type application/xml though, so I'd guess that that's where your problem lies on the other page in Chrome, Safari, and perhaps Internet Explorer.
This does absolutely nothing to set the MIME type of the relevant resource; that can only be set by the server either by a file extension rule (which servers have by default), a directory rule, or code in the file itself (e.g., PHP).
(While type="text/xsl" in the xml-stylesheet processing instruction may be required to make your code work in certain browsers (particularly Internet Explorer), technically, that's not the correct MIME type; it's a legacy MIME type used before the formalization of a MIME type. The correct types are the generic XML MIME type application/xml and application/xslt+xml, which is defined in the XSLT 2.0 specification, but is not quite as well supported because it is newer (though still years old).
Quote:
Originally Posted by apinrise
Okay, so uploading the ead.dtd file to the same directory as my XML and XSL files--along with changing the mime type to text/xsl--seems to have done the trick. I can now access the site through Chrome, Safari and Firefox. I don't have access to IE, however.
This might indicate you have a directory rule which causes the MIME types to be sent out differently. I never read what you specified in the xml-stylesheet PI for both pages, so that could have been a part of the problem too.
__________________
Please for the love of god stop making IE. You current "browser"s cause me to cry every day. —Phil *