Anne van Kesteren

Media type, namespace mismatch

The question raised by dolphinling about Content-Type/namespace mismatch is something I hope the W3C CDF WG is going to answer at some point. How it should be processed by the user agent is in my opinion pretty clear. Given that the namespace is the SVG namespace and the SVG is correct et cetera it should just be rendered. Most user agents work with some kind of namespace dispatching mechanisms. If something is XML for each Element node it is determined how it is rendered based on the namespace and local-name and perhaps required related elements (each SVG element needs some kind of ancestor with local-name svg in the SVG namespace) and associated style rules, if any.

Whether or not the Content-Type has to say anything about the semantics of the document is more difficult. Especially in this case, because both are XML media types in the end. If it was about text/html versus application/xhtml+xml the answer would have been more clear.

Beware of the editor.

Comments

  1. As I see it, different XML media types for different XML languages that use namespaces is only really useful for content negotiation and possibly a few other things. If any XML media type is recieved, it should invoke the UAs XML processor and from then on, all semantics are attained from the namespace and that determines how to handle it. If the XML language doesn't use namespaces, then the the media type may have more effect, but I'm not exactly sure what effect that would be.

    Posted by Lachlan Hunt at

  2. Ditto Lachlan.

    Posted by Aristotle Pagaltzis at

  3. Makes sense. (And is not really different from what I said in the post above I believe.) XML media types are a bit of a mess anyway.

    Posted by Anne at

  4. This is a rather difficult situation I'd say. I say overall I do agree with Anne, mainly because I don't see why you would hold it back from rendering in this situation.

    Posted by Ethan Poole at

  5. Have you chatted with the TAG about this? It would seem to relate quite directly to their Authoritative Metadata finding. It may be a better place to solve that than the CDF WG.

    Posted by Robin Berjon at

  6. Metooing to what Lachlan said. Let’s hope the Official Specs on this subject do not turn out as impractical as the character encoding facet of RFC 3023.

    Hmm. I have implemented the character encoding facet of RFC 3023, but I provide a checkbox for turning it off. Should I get the t-shirt or not?

    Posted by Henri Sivonen at

  7. Given that the guy who made the t-shirt effectively does the same thing, sure. At some point I should order one myself as well.

    Posted by Anne at

  8. The content type is a means for the user agent to determine (and negotiate) whether he can process the content. If someone puts the incorrect content type on a file, but the content is renderable by the user agent, then he’s just lucky. User agents should render the SVG if they can.

    ~Grauw

    Posted by Laurens Holst at