HTML and CSS Reference
In-Depth Information
Another registered XML media type is application/atom+xml , which is used for the Atom Syndication Format
(see Chapter 8) defined by RFC 4287 [6]. Other frequently used XML media types of this kind are application/rss+xml
(RSS; see Chapter 8), application/mathml+xml (MathML; see Chapter 3), image/svg+xml (SVG; see Chapter 3), and
application/xslt+xml (XSLT; see Chapter 5). The full list of MIME types is published on the IANA web site [2].
The Content-Type field of the HTTP header describes the data format as a MIME media type (Listing 4-2).
Additionally, this entry can also provide the character encoding of the document (as discussed earlier in Chapter 2).
Listing 4-2. A Content-Type Example
Content-Type: application/xhtml+xml; charset=UTF-8
The MIME type of web pages can also be set on the document level with the meta element such as in Listing 4-3.
Listing 4-3. MIME Type Declaration with the meta Element
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
Generally, the MIME type text/html is used for HTML documents, and the application/xhtml+xml is used for
XHTML documents. However, XHTML documents can be served with both (as we'll see later in the chapter).
The wide variety of Internet media types is not fixed. Custom MIME types can also be registered at IANA [7].
Common Media Types
The most common media types are listed in the next sections. Note that this is not a full list by any means.
Application-Specific Media Types
Table 4-1 summarizes the most common application-specific MIME types. 2
Table 4-1. Common Application-Specific Media Types
Media Type
Specification
Description
application/atom+xml
RFC 4287 [6], RFC 5023 [8]
Atom news feed
application/ecmascript
RFC 4329 [9]
ECMAScript
application/javascript
RFC 4329 [9]
JavaScript
application/json
RFC 4627 [10]
JavaScript Object Notation
application/mathml-content+xml
MathML 3.0, Appendix B [11]
Content MathML
application/mathml-presentation+xml
MathML 3.0, Appendix B [11]
Presentation MathML
application/mathml+xml
MathML 3.0, Appendix B [11]
MathML
application/octet-stream
RFC 2046 [12]
Nonspecified binary data
application/ogg
RFC 5334 [13]
Ogg multimedia container
( continued )
2 Cannot be used in IE8 or earlier
 
Search WWH ::




Custom Search