[DAS2] Content type for DAS XML responses

Andrew Dalke dalke at dalkescientific.com
Sat Dec 18 05:44:35 UTC 2004

> Currently, the DAS/2 spec dictates that responses should have 
> content-types
> like:
>   application/x-das-source
>   application/x-das-types
>   application/x-das-region
> Changing these to be 'text/xml' would be more convenient since the 
> content
> would then be viewable in a standard web browser.

A browser should send something like

Accept: */*
Accept: application/xml

or some other generic content type in its headers.  One solution
to at least consider is that IF a client does not request
application/x-das-whatever THEN return application/xml .  I do
not believe this is appropriate though.

>   text/xml; dasformat=source
>   text/xml; dasformat=types
>   text/xml; dasformat=region

I get confused; is it "text/xml" or "application/xml"?  Ah-ha!
RFC 3023 says (  http://www.faqs.org/rfcs/rfc3023.html )

    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.

That RFC is relevant to this discussion.  If I understand it
correctly it recommends using something more like


This would be understood by RFC 3023 compliant clients as
containing an XML document, by DAS clients to understand
which DAS XML format is used, and by generic clients to
contain an XML document.

> The corresponding compact content-types could be:
>   text/plain; dasformat=compact-source
>   text/plain; dasformat=compact-types
>   text/plain; dasformat=compact-region

There should be no need for this.  A client should use
the catch-all text/* handler for text/x-compact-source
and show it as normal text.

> And other types could be:
>   text/plain; dasformat=fasta
>   text/plain; dasformat=gff3
>   text/plain; dasformat=bed

Same for these.  What's the problem with
   text/x-fasta , etc.?

See also the discussion in appendix A.5 which describes
practical problems about using parameter in MIME types.

					dalke at dalkescientific.com

More information about the DAS2 mailing list