http://www.perlmonks.org?node_id=199967


in reply to Getting Netscape to use a linked XSL stylesheet

Hi,

I think ++BUU is right. When you load the file via HTTP, Netscape has to believe of whatever content type the server claims the file is. And I'd bet that it gets text/plain as the content type (maybe that's actually what you send it through CGI.pm), or no content type, where it'll probably assume text/plain. And in a plain text file, it does not expect and thus not obey any processing instructions (like your stylesheet link)

Now, if you save the file, and load it (as a file:// URI) in Netscape, it's on it own with determining the mime type. It sees the XML ending and assumes a text/xml content type. Being in XML context now, it sees, interprets and obeys the sylesheet PI.

I wonder what the HTTP specs say about what to assume if no content type is given. If it says text/plain is to be assumed, then actually IE6 misbehaves. But maybe it allows (or even encourages) browsers to apply their own type recognitions, when the server doesn't tell. When I got time I'll eventually read into it, and update this node.

Hope this lifts the fog,
so long,
Flexx