Subject: [apps-discuss] Media Type for HTML 'snippets'?

From: Jan Algermissen <[email-masked]>
Date: Wed, 10 Oct 2012 13:03:03 +0200

Hi,

I am looking for an appropriate media type to use when serving HTML snippets that have a <div> as their root element.

I feel that serving HTML document fragments has become such a common scenario, I think there must be some solution already. However - I cannot find anything appropriate.

The closest thing is likely Atom's type attribute: http://tools.ietf.org/html/rfc4287#section-3.1.1.3

Can anyone provide a pointer or ideas?

Or is it time probably time for application/xhtml-div+xml

Jan

---

From: Larry Masinter <[email-masked]>
Date: Wed, 24 Oct 2012 19:42:44 -0700

Content-type annotations are only advisory, in a world where receivers regularly "sniff" the content and override the content-type label anyway.

Since you have an application which receives these snippits and processes them, and you don't want intermediaries or proxies to rewrite them, search them, or do any generic processing of the content,  perhaps "application/octet-stream" would be appropriate. Or no content-type at all... who cares?

The new registration for text/html  http://www.iana.org/assignments/media-types/text/html
points to the HTML5 spec;  snippets wrapped  <div>   </div> would be processed fine, so "text/html" would be appropriate.

If you mean for the snippets to be processed as XML and not as HTML, consider 
(from http://tools.ietf.org/html/draft-lilley-xml-mediatypes-00 ) 
"text/xml-external-parsed-entity" (or "application/xml-external-parsed-entity") might do you.

> -----Original Message-----
> From: [email-masked] [mailto:[email-masked]]
> On Behalf Of Jan Algermissen
> Sent: Wednesday, October 10, 2012 4:03 AM
> To: [email-masked] application-layer protocols
> Subject: [apps-discuss] Media Type for HTML 'snippets'?
> 
> Hi,
> 
> I feel that serving HTML document fragments has become such a common
> scenario, I think there must be some solution already. However - I cannot find
> anything appropriate.
> 
> The closest thing is likely Atom's type attribute:
> http://tools.ietf.org/html/rfc4287#section-3.1.1.3
> 
> _______________________________________________
> apps-discuss mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/apps-discuss

---

From: Henri Sivonen <[email-masked]>
Date: Thu, 25 Oct 2012 13:34:21 +0300

> points to the HTML5 spec;  snippets wrapped  <div>   </div> would be processed fine, so "text/html" would be appropriate.

Parsing such as snippet as text/html results in a document with "html"
as its root element. (Parsing text/html *always* results in the root
being "html" regardless of the contents of the file.)

-- 
Henri Sivonen
[email-masked]
http://hsivonen.iki.fi/