0

I have a xsl file that is saved as whatever.php. the style sheet is called by <?xml-stylesheet type="text/xsl" href="whatever.php"?>
I get an error on firefox that it does not have the correct mime type.
I save the xsl file under php because I need to use php in the code to execute certain functions. What is the correct mime type for firefox?

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by Dsiembab
1

Here are a few 'possible' solutions. I haven't tested them, but they should work in my opinion.

1) Set the headers for PHP file to xml. Most browsers don't parse XML files if they have unknown extensions.

header('Content-Type: text/xml');
header('Content-Disposition: inline; filename=sample.xml');

2) Try using mod rewrite so that you call whatever.xml instead of whatever.php

Votes + Comments
thanks
0

I'll have to try that, I actually just ended up parsing it with javascript so I could make it into an ajax app. thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.