MIME types in DAL services

Mark Taylor m.b.taylor at bristol.ac.uk
Mon Apr 23 11:39:33 PDT 2007


On Mon, 23 Apr 2007, Doug Tody wrote:

> Hi Mark -
>
> I actually did a test to check on this: I modified a test copy of my
> DALServer code to return application/x-votable+xml, and then tried
> the standard test query.  Both Firefox and IE fail to do anything
> useful with the response, producing a popup instead.  If instead we
> use "text/xml" or "text/xml;<anything>" then the browser will display
> the response as pretty-printed XML.
>
> I think this makes sense; basically what the MIME type is telling
> the browser to do is direct the document to whatever application is
> registered for this specific MIME type.  The "text/xml;<subtype>"
> version reverses the priority, hence may be more appropriate for
> cases where a generic display capability is desirable (such as for
> the query response).  Use of a stylesheet is also possible with a
> document identified to a browser as text/xml.

Doug,

I think this behaviour is (maybe that's wishful thinking and I just
mean "should be") at least partly down to the difference 
of the top-level media type ("application" rather than "text").
The general sense of "application" is that you need a dedicated 
viewer application to make sense of it, there is no point presenting 
it to the user as retrieved.  The general sense of "text" is that 
it is to be presented to the user as is.

This would suggest that a MIME type of text/x-votable+xml might
be better for the query response at least.  If I try this on
firefox, I get the default option to view it in emacs.  I don't
want to do this (there's presumably some way of configuring
firefox to view text in some other way), but it's more helpful 
than no default.  However, it's still probably not as helpful
as long as you're using firefox than having it displayed inline
as pretty-printed XML.  I don't know how IE or other browsers react.

I'd argue that text/x-votable+xml is more correct than text/xml, 
and that a browser which does not treat them in the same way when
it doesn't know about VOTables is indication that its authors
haven't read RFC3023 carefully enough.  However, as I say, I'm 
prepared to be swayed by pragmatic considerations, so on these
grounds I wouldn't argue against using text/xml for query responses
(though like you I'd be more reluctant to use it for datasets).
I'm not sure about the non-standard subtype optional parameter however.

Mark

-- 
Mark Taylor   Astronomical Programmer   Physics, Bristol University, UK
m.b.taylor at bris.ac.uk +44-117-928-8776 http://www.star.bris.ac.uk/~mbt/



More information about the dal mailing list