As I understand MySource Matrix (v4.5), the Add… 'File' asset displays content as html/text.
However, I wish to display structured xml files - actually Resource Description Framework (RDF) through Matrix, with a mime type of rdf/text.
Can this be achieved?
Mime types
Live, publically readable files are delivered with whatever MIME type is configured by Apache (as these files are served directly by Apache). While the files are still Under Construction, they are still served via Matrix. Perhaps you should submit a feature request to be able to set the MIME type on a generic file asset?
There is also a design area that allows you to change the content-type of the output. I use this design area to dynamically create RSS and other XML feeds using the existing Asset listing.
When matrix serves the file asset, it checks the extension in a list of known mime types and sends the correct header.
Funnily enough, XML files are not in the list of types and should be added so the headers are sent correctly.
Thanks for the quick reply… can I suggest that these mime types are added:
Format - ‘MimeType’ - (LegacyMimeType)
xhtmlv1.0 - ‘application/xhtml+xml’ (text/html)
xhtmlv1.1+ - ‘application/xhtml+xml’
xml/xsl - ‘application/xml’ (text/xml)
rdf - ‘application/rdf+xml’ (text/rdf)
rss - ‘application/rss+xml’ (text/xml)
(With the advised addition of a content-type negotiation script, which be used to serve documents with different MIME types to different browsers)
Reference:
http://www.w3.org/TR/xhtml-media-types/#media-types
http://www.w3.org/TR/xhtml-media-types/#media-types
http://www.w3.org/TR/xhtml-media-types/#media-types
If you submit a bug for this on our bug tracker (http://bugs.matrix.squiz.net) it will probably be fixed by the next release.
Just a note on this, if we start serving all xhtml pages as application/xhtml+xml (as they really should be, but that's a whole other argument), IE won't render them (it will download the file instead).
Or a content-type negotiation script could be added - to allow incompetent browsers (like IE) to gently fall-over into ‘legacy mode’ without annoying anyone ( - with download prompts, in this case).
Explaination~
http://mathibus.com/archive/2005/04/php-xhtml-content-negotiation
PHP Code~
http://mathibus.com/archive/2005/04/php-xhtml-content-negotiation
Or even better a custom asset type for-which the mime-type can be set manunally… ?! Thanks all.
You can already do this in the design (from v3.6 onwards):
Though, this tag MUST appear at the top of the parsefile to work properly.