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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Newcastle, England
    Posts
    178
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Strange Mozilla behaviour?

    I have a few XML demo pages on my site. All of them have been checked out using both IE6 and Mozilla 1.0 and they perform as expected when accessed from the C: drive. When I upload them to my site however Mozilla does not want to play. I click on a link and get the status message "Document:done", but the display does not change. However if I then click on "View Source" I get the coding for the page I am trying to access. I just don't understand it. Can anyone shed any light on this?

    Here is a link to one of the pages:

    http://www.patrick-brennan.com/xml/photo_album.xml

    Patrick

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Shouldn't XSL be served as text/xml, not text/xsl (I don't believe that is a correct mime-type)?

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Newcastle, England
    Posts
    178
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Jason,

    Where are you picking up the mime type text/xsl?

    patrick

  • #4
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    second line
    <?xml-stylesheet type="text/xsl" href="photo_album.xsl"?>

    Moderator: General web building

    Get out from under them, resist and multiply.
    Get out from under precipice and see the sky.

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Newcastle, England
    Posts
    178
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK - I wasn't sure what Jason was referring to. The line you quote is the format recommended in all the XSL references I have read. It's also the format used in the W3Schools web tutorials - for example check out the following link (which incidentally transforms nicely in Mozilla!)

    http://www.w3schools.com/xsl/cdcatalog_with_xsl.xml

    Your comments led me to experiment however and what I discovered was that if I rename my xsl stylesheet and give it a .xml suffix then it works fine. It may be that my ISP server doesn't properly serve up the .xsl mime-type - though why that doesn't also affect Internet Explorer is a mystery to me.

    update: I copied the w3schools xml and xsl files to my site and got exactly the same behaviour - transformation with IE but not Mozilla, even though Mozilla does successfully transform these same files when I access them directly from w3schools.com. The problem must therefore be due to the way my site server is dishing up the files.

    patrick
    Last edited by mpjbrennan; 01-18-2003 at 02:41 PM.

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Personally, I've had very little succes in client-side transformation in mozilla; perhaps for the same reasons as you (whatever they are - sorry I don't know) ... I never really investigated because IMHO client-side transformation is a non-starter for practical applications; I'd do it server-side.

  • #7
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    I got the text/xsl mime-type from trying to view your XSLT document on your server. It asks me to download it (claiming the mime-type is text/xsl.)

    As unbelievable as this sounds, but w3schools is often trash when it comes to XML and such. There is no such mime-type as text/xsl. It is simply IE being stupid, once again. (Kind of like older versions of MSXML not supporting the correct XSLT namespace)

    However, Mozilla does let you do type="text/xsl" in the processing instruction tag, because I believe IE requires it (it is so stupid!!).

    However, the document MUST be served as text/xml, as per the XSLT 1.0 specification. Mozilla has strict enforcement of mime-types. Unlike IE, it doesn't do mime-type second-guessing or even overriding based on the extension, as file extensions are meaningless on the web.


    I've never had any problems with client-side XSLT transformation in Mozilla when I'm doing everything correctly.

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Location
    Newcastle, England
    Posts
    178
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Jason,

    It isn't just w3schools that use the link

    <?xml-stylesheet type="text/xsl" href=some_file.xsl"?>

    - Michael Kay also uses it in his book "XSLT" 2nd edition. Most people regard this as a fairly definitive work.

    Older versions of IE supported the working draft namespace for xsl because there wasn't anything else at the time - I don't think that was being stupid, I think it was being helpful, giving users a tool to experiment with. Present versions of IE use the correct namespace.

    I found your comments regarding mime-types very interesting and from a brief read of the subject at IANA I see that you are right that text/xsl is not a recognised type. I shall look into this further.

    patrick
    Last edited by mpjbrennan; 01-18-2003 at 07:55 PM.

  • #9
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by mpjbrennan
    Jason,

    It isn't just w3schools that use the link

    <?xml-stylesheet type="text/xsl" href=some_file.xsl"?>

    - Michael Kay also uses it in his book "XSLT" 2nd edition. Most people regard this as a fairly definitive work.
    Well it is technically incorrect. I think it is common practice because IE requires it (? I don't actually remember if it transform with type="text/xml" or not...), and Mozilla is smart enough to use the real mime-type of the file.

  • #10
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by mpjbrennan
    Older versions of IE supported the working draft namespace for xsl because there wasn't anything else at the time - I don't think that was being stupid, I think it was being helpful, giving users a tool to experiment with. Present versions of IE use the correct namespace.
    Yes, that was very nice. However after XSLT was standardized, it didn't support the correct namespace for some time. That was what bugged me.

  • #11
    Regular Coder
    Join Date
    Jun 2002
    Location
    Newcastle, England
    Posts
    178
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Jason,

    Can you help me with one more aspect. I have changed all my xsl stylesheets to .xml and they now render satisfactorily in both IE and Mozilla. As I am in the process of migrating from Windows to Linux this is v. important for me. However, I find that in Mozilla all my pages are surrounded with a white margin. How can I get rid of this? I have looked through the CSS spec but cannot find any answer. The following page gives an example:

    http://www.patrick-brennan.com/xml/photo_album.xml


    thnx in anticipation

    patrick

  • #12
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Err, that's pretty odd. Perhaps:

    *:root {
    margin: 0;
    }

    Will fix it? I'm assuming the margin is being generated by the <html> element.... (you could use "html { }" as the selector in that case).

  • #13
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't wanna stray off topic too much ... or rant too much ... but doesn't all this cross-browser XML parsing idiosynchrasies stuff just turn you off completely? I don't dispute for a second that mozilla is correct over IE, but it's not that - it's that XML is supposed to free us from tedious environment specific logic. Why have any truck with anything that makes that harder?

    Personally, I have no time for client-side transformation at all; or is there something amazingly useful which can't be done any other way but client-side, and I'm just failing to see it?

  • #14
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Originally posted by brothercake
    Why have any truck with anything that makes that harder?
    You're not. This is why IE is continuing to stunt and retard the future of the web.

    The only advantage I've come across with client-side transformations is that you don't need a server with sablotron or something equivalent installed, which is an issue for some people. It also takes some load off the server, especially if you're transforming relatively large documents.

  • #15
    Regular Coder
    Join Date
    Jun 2002
    Location
    Newcastle, England
    Posts
    178
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Jason - I hadn't thought of assigning the background attribute to the html element but it did the trick.

    I think it's a little extreme to say that IE is stunting and retarding the future of the web. Standards are important, but only if they are good standards. Personally I think the XSLT standard is flawed in one major aspect - it relies upon a processing instruction to be embedded in the XML document which is being transformed. This defeats the central objective of having pure data in an XML document. IMHO an XSL stylesheet should import the XML document it is to transform. The it would truly be possible for an XML document to be transformed by several different stylesheets.

    End of rant - once again thanks for the assistance.

    patrick


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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