Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,342
    Thanks
    13
    Thanked 349 Times in 345 Posts
    which are the other browsers that you have tried?

    PS. seems to be working in Chrome
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #3
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,342
    Thanks
    13
    Thanked 349 Times in 345 Posts
    oh, sorry, I tried the other one (which you stated working)
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #5
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,304
    Thanks
    28
    Thanked 276 Times in 270 Posts
    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.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #6
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,304
    Thanks
    28
    Thanked 276 Times in 270 Posts
    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.
    Last edited by Arbitrator; 07-12-2012 at 08:22 AM. Reason: I added the last sentence in the third paragraph.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • Users who have thanked Arbitrator for this post:

    apinrise (07-12-2012)

  • #7
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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"?>

  • #8
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.

  • #9
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,304
    Thanks
    28
    Thanked 276 Times in 270 Posts
    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.
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •