I'm trying to render XML+XSL 2.0 in browser, returning .xml
pages with application/xml
content type and .xsl
pages with text/xml
. Safari is complaining for the main document: "Resource interpreted as document but transferred with MIME type application/xml." (but keeps rendering everything just fine).
I want to get rid of this warning message. What content-types should be used for the XML document?
XSL gives a developer the tools to describe exactly which data fields in an XML file to display and exactly where and how to display them. Like any style sheet language, XSL can be used to create a style definition for one XML document or reused for many other XML documents.
An XSL file is a style sheet that can be used to transform XML documents into other document types and to format the output.
XSL - More Than a Style Sheet Language XSL-FO - a language for formatting XML documents (discontinued in 2013)
I've had success using text/xml
with the stylesheet as text/xsl
(or perhaps this is OK as text/xml
as you have it working). text/xsl
is widely recognized, but not "official" (as far as I understand it).
According to RFC 3023: "If an XML document that is, the unprocessed, source XML document is readable by casual users, text/xml
is preferable to application/xml
. MIME user agents (and web user agents) that do not have explicit support for text/xml
will treat it as text/plain, for example, by displaying the XML MIME entity as plain text. application/xml
is preferable when the XML MIME entity is unreadable by casual users."
See https://www.rfc-editor.org/rfc/rfc3023#page-16
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With