Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-11-2012, 02:01 AM   PM User | #1
apinrise
New to the CF scene

 
Join Date: Jul 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
apinrise is an unknown quantity at this point
XSLT stylesheet works only in Firefox

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.

Thanks so much (in advance),
Ryan
apinrise is offline   Reply With Quote
Old 07-11-2012, 07:23 AM   PM User | #2
Dormilich
Senior Coder

 
Dormilich's Avatar
 
Join Date: Jan 2010
Location: Behind the Wall
Posts: 2,874
Thanks: 9
Thanked 291 Times in 287 Posts
Dormilich is on a distinguished road
which are the other browsers that you have tried?

PS. seems to be working in Chrome
__________________
please post your code wrapped in [CODE] [/CODE] tags
Dormilich is offline   Reply With Quote
Old 07-11-2012, 03:12 PM   PM User | #3
apinrise
New to the CF scene

 
Join Date: Jul 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
apinrise is an unknown quantity at this point
http://ryanbuckley.ca/findingaid/chusseau-flaviens.xml works for you in Chrome? It isn't loading for me in version 19.0 nor version 20.0. I can't seem to load the files in Internet Explorer either.
apinrise is offline   Reply With Quote
Old 07-11-2012, 03:29 PM   PM User | #4
Dormilich
Senior Coder

 
Dormilich's Avatar
 
Join Date: Jan 2010
Location: Behind the Wall
Posts: 2,874
Thanks: 9
Thanked 291 Times in 287 Posts
Dormilich is on a distinguished road
oh, sorry, I tried the other one (which you stated working)
__________________
please post your code wrapped in [CODE] [/CODE] tags
Dormilich is offline   Reply With Quote
Old 07-12-2012, 07:49 AM   PM User | #5
Arbitrator
Senior Coder

 
Arbitrator's Avatar
 
Join Date: Mar 2006
Location: Splendora, Texas, United States of America
Posts: 2,895
Thanks: 5
Thanked 187 Times in 184 Posts
Arbitrator is on a distinguished road
Quote:
Originally Posted by apinrise View Post
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 *
Arbitrator is offline   Reply With Quote
Old 07-12-2012, 08:19 AM   PM User | #6
Arbitrator
Senior Coder

 
Arbitrator's Avatar
 
Join Date: Mar 2006
Location: Splendora, Texas, United States of America
Posts: 2,895
Thanks: 5
Thanked 187 Times in 184 Posts
Arbitrator is on a distinguished road
Quote:
Originally Posted by apinrise View Post
http://ryanbuckley.ca/findingaid/chusseau-flaviens.xml works for you in Chrome? It isn't loading for me in version 19.0 nor version 20.0. I can't seem to load the files in Internet Explorer either.
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.
Arbitrator is offline   Reply With Quote
Users who have thanked Arbitrator for this post:
apinrise (07-12-2012)
Old 07-12-2012, 03:10 PM   PM User | #7
apinrise
New to the CF scene

 
Join Date: Jul 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
apinrise is an unknown quantity at this point
Quote:
Originally Posted by Arbitrator View Post
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 View Post
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.
Code:
<?xml-stylesheet type="text/xsl" href="webead.xsl"?>
apinrise is offline   Reply With Quote
Old 07-12-2012, 03:25 PM   PM User | #8
apinrise
New to the CF scene

 
Join Date: Jul 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
apinrise is an unknown quantity at this point
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.
apinrise is offline   Reply With Quote
Old 07-13-2012, 12:01 PM   PM User | #9
Arbitrator
Senior Coder

 
Arbitrator's Avatar
 
Join Date: Mar 2006
Location: Splendora, Texas, United States of America
Posts: 2,895
Thanks: 5
Thanked 187 Times in 184 Posts
Arbitrator is on a distinguished road
Quote:
Originally Posted by apinrise View Post
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:").

I'm not 100% sure that the document type declaration is the cause of quirks mode, but to add one is a simple matter of adding an output element to your XSLT style sheet with a system-identifier="about:legacy-compat" attribute. (If you want to know why that value, read the relevant part of the HTML5 spec at http://dev.w3.org/html5/spec/syntax.html#the-doctype or http://www.whatwg.org/specs/web-apps...ml#the-doctype.)

Quote:
Originally Posted by apinrise View Post
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.

Quote:
Originally Posted by apinrise View Post
Code:
<?xml-stylesheet type="text/xsl" href="webead.xsl"?>
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 View Post
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 *
Arbitrator is offline   Reply With Quote
Reply

Bookmarks

Tags
ead, xml, xsl, xslt

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:16 PM.


Advertisement
Log in to turn off these ads.