Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Getting Netscape to use a linked XSL stylesheet

by joe++ (Friar)
on Sep 23, 2002 at 15:48 UTC ( [id://200141]=note: print w/replies, xml ) Need Help??


in reply to Getting Netscape to use a linked XSL stylesheet

Hi,

Apart from finding out whether the browser actually tries to load the stylesheet (server logs?) and to check the content type (mime type "text/xml"), there are two additional differences between MSIE and NS which could wreak havoc here:

  • Mozilla (Netscape's engine) does NOT parse generated html from a XSL tranformation, but rather takes the result tree from the transform literally and tries to render this. So you want to transform into valid xhtml
  • MSIE still tries to conform to an early, preliminary XSLT specification which predated the official W3C version. Mozilla doesn't and you shouldn't, because as of MSXML 3.0 (roughly MSIE 5.5, one of those service packs) Explorer is fully compliant with the correct XSLT spec.
This - and more - is briefly documented at Mozilla's XSLT project page.

--
Cheers, Joe

  • Comment on Re: Getting Netscape to use a linked XSL stylesheet

Replies are listed 'Best First'.
Re: Re: Getting Netscape to use a linked XSL stylesheet
by AlistairFromScotland (Initiate) on Sep 23, 2002 at 20:45 UTC

    Thanks, but I'm assuming that if Netscape 6.1 can handle the XML correctly (i.e. transform it to XHTML using the XSL file) when it loads it from a file, rather than being passed it from the CGI script, then the XML and the XHTML must be valid.

    It would be nice to be able to capture the XHTML produced by the XSL file and then run it on W3C's validator to check that it's 100% valid, but the XHTML gets generated invisibly inside the browser. Doing a "View Source" just shows the XML. However, I'm pretty sure it is valid XHTML.

    I've checked the Mozilla XSLT project page but it didn't help. It says that the stylesheet should be text/xml as well as the source, but if I use text/xml rather than text/xsl
    a) Netscape 6.1 won't transform it, even when I load the XML from a file
    b) IE won't transform it either.

    I've also checked that I'm using the correct namespace for xsl (as specified on the Mozilla XSLT project page).

    I've pretty much run out of ideas. Somebody else must have come up against this problem. There's got to be a solution out there.

    I could of course just do it the easy way and get the Perl script to write the HTML. But I want to do the transformation on the client side. And I keep hearing how Mozilla/Netscape is All-Good and IE is the Pure Evil, so how come it works flawlessly in IE whereas Netscape 6.1 just acts dumb and shows me the XML?

    Alistair

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://200141]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-25 16:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found