{"id":258,"date":"2004-01-19T10:36:00","date_gmt":"2004-01-19T14:36:00","guid":{"rendered":"http:\/\/www.markbaker.ca\/wp\/?p=253"},"modified":"2004-01-19T10:36:00","modified_gmt":"2004-01-19T14:36:00","slug":"xml-namespace-dispatching-with-applicationxml","status":"publish","type":"post","link":"http:\/\/www.markbaker.ca\/blog\/2004\/01\/xml-namespace-dispatching-with-applicationxml\/","title":{"rendered":"XML namespace dispatching with application\/xml"},"content":{"rendered":"<p>Norm&#8217;s playing around with media types.\n<a href=\"http:\/\/norman.walsh.name\/2004\/01\/17\/application-xml\">This one<\/a>\nis served with <a href=\"http:\/\/www.iana.org\/assignments\/media-types\/application\/#xml\">application\/xml<\/a>.<\/p>\n\n<p>Let&#8217;s have a look at what <em>should<\/em> happen in a perfect world if\nXHTML is served with that media type.\n<a href=\"http:\/\/www.ietf.org\/rfc\/rfc3023.txt\">RFC 3023<\/a> says;<\/p>\n\n<blockquote>\nAn XML document labeled as text\/xml or application\/xml might contain\nnamespace declarations, stylesheet-linking processing instructions\n(PIs), schema information, or other declarations that might be used\nto suggest how the document is to be processed.  For example, a\ndocument might have the XHTML namespace and a reference to a CSS\nstylesheet.  Such a document might be handled by applications that\nwould use this information to dispatch the document for appropriate\nprocessing.\n<\/blockquote>\n\n<p>What that means is that one cannot assume that namespace\ndispatching will occur, and therefore the semantics of application\/xml are\nambiguous; it is reasonable that the recipient see it as XHTML\/HTML, but also\nreasonable that they see it as &#8220;XML&#8221; (such as in the IE XML tree view).<\/p>\n\n<p>In the real world of course, reality can trump specification; concensus\n(in the form of running code) may very well be that namespace dispatching\nis assumed, and in that case at least the ambiguity vanishes.  But then\nwe&#8217;ve lost the ability to send plain-old XML.  For example if somebody asks\nme for a sample XML document, I&#8217;d like to be able to send them some XHTML\nwithout it being interpreted by the other end as XHTML, just XML.  I think\nit would be great if application\/xml could be used for this purpose, but\nit&#8217;s not a huge deal; text\/plain would also be appropriate in many cases.<\/p>\n\n<p>So I set up a <a href=\"http:\/\/www.markbaker.ca\/2004\/01\/XmlNamespaceDispatchTest\/\">little test<\/a>.\nLet me know what you see and I&#8217;ll record it.  It could be useful in the\nsoon-to-come revision to 3023, enabling us to be a bit more specific\nthan &#8220;might&#8221;.<\/p>","protected":false},"excerpt":{"rendered":"Norm&#8217;s playing around with media types. This one is served with application\/xml. Let&#8217;s have a look at what should happen in a perfect world if XHTML is served with that media type. RFC 3023 says; An XML document labeled as text\/xml or application\/xml might contain namespace declarations, stylesheet-linking processing instructions (PIs), schema information, or other [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[40],"class_list":["post-258","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-xml"],"_links":{"self":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/comments?post=258"}],"version-history":[{"count":0,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/posts\/258\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/media?parent=258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/categories?post=258"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.markbaker.ca\/blog\/wp-json\/wp\/v2\/tags?post=258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}