[14] [[媒体型]]名 [DFN[[CODE(MIME)[application/xhtml+xml]]]]
は、 [[XHTML]] を表します。

- [1] ''XHTML Media Types'' <http://www.w3.org/TR/xhtml-media-types/>
-- [CODE(MIME)[application/xhtml+xml]] と 
[CODE(MIME)[[[text/html]]]] などの使い分けに関する [[W3C]]
[[HTML WG]] の [[Working Group Note]]。
-- [2] ''XHTML Media Types (邦訳)'' <http://www.satoshii.org/spec/xhtml-media-types/>

[[#comment]]


* 引数

[15]
,名前	,値	,既定値	,意味	,出典
,[CODE(MIME)[[[charset]]]]	,[CODE(MIME)[charset]]	,(自動)	,Charset	,[RFC 3236]
,[CODE(MIME)[[[profile]]]]	,[[URI参照]]	,(なし)	,プロファイル	,[RFC 3236]
,[CODE(MIME)[schema-location]]	,URI 参照	,(なし)	,プロファイル	,[RFC 3236] になる前の I-D

[[#comment]]


** charset 引数

[8] [[Apache]] は [CODE[[[AddDefaultCharset]]]] していても 
[CODE(MIME)[[[application/[VAR[*]]]]]] には 
[CODE(MIME)[[[charset]]]] 
パラメーターを与えてくれないから注意が必要。

[9] >>8 Apache が対応するまでは [CODE[[[AddCharset]]]] 
でも使って回避すべし (例: [SAMP[AddCharset iso-2022-jp .xhtml]])。

[[#comment]]


** profile パラメーター

[4] [DFN[[CODE(MIME)[[[profile]]]]]] パラメーターは、 
XHTML の具体的にどんなものであるかを示すものです。
RFC 3236 の8節で定義されています。
古い [[I-D]] では [CODE(MIME)[schema-location]] という名前でした。

しかし、 W3C の XHTML 
の仕様書でこのパラメーターの具体的な値を規定したものは1つもありません。
(提案だけしといて随分のんきなもんです。)

[5] RFC 3236 の例から、 [[XHTML Basic]] では
<http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd> 
を使うことが分かります。

これから類推するなら、 W3C XHTML ではその DTD の最新版 
(日付の入っていない) 
URI を使えばよいのでしょう。

[6] もっとも、 RFC 3236 は用途を[[内容折衝]]に限定しており、
しかも過渡期のものだと言っていますから、
わざわざ使う必要はないでしょう。

だけど、 [CODE(HTMLe)[[[html]]]] 要素の [CODE(HTMLa)[[[version]]]] 
属性にしろ [CODE(HTMLe)[[[head]]]] 要素の 
[CODE(HTMLa)[[[profile]]]] 属性にしろ、
この手のものはどうして役に立たん (役に立つように使われない) 
のですかね?

[7] ところで、 [CODE(HTMLe)[head]] 要素の [CODE(HTMLa)[profile]]
属性は[[空白]]で区切って複数の URI 参照を指定できました。
(ただしその意味は将来のために予約。) こちらの [CODE(MIME)[profile]]
引数ではどうなんでしょうかね?

[10] <http://pc2.2ch.net/test/read.cgi/hp/1028659057/110-129>

[11] ''XHTML-Print'' 
<http://www.pwg.org/xhtml-print/HTML-Version/XHTML-Print.html>
という小型印刷機用の [[XHTML 1]] 仕様では、
<http://www.xhtml-print.org/xhtml-print/xhtml-print10.dtd>
を使っています。

[56] 
> [CODE(MIME)@en[application/xhtml+xml;profile="http://www.wapforum.org/xhtml"]]

* 歴史


* メモ

** RFC 3236

[3] [[RFC 3236]] <urn:ietf:rfc:3236>: 
[CODE(MIME)[application/xhtml+xml]] を規定し、 [[IANA]]
に登録する[[情報提供]] [[RFC]]。



- [59] <http://www.w3.org/MarkUp/2000/draft-baker-xhtml-media-reg-00.txt>
- [60] <http://www.w3.org/MarkUp/2001/draft-baker-xhtml-media-reg-01.txt>
- [61] <http://www.watersprings.org/pub/id/draft-baker-xhtml-media-reg-02.txt>
- [62] [CITE[Last Call: The 'application/xhtml+xml' Media Type to Informational]] <http://www1.ietf.org/mail-archive/ietf-announce/Current/msg14600.html>
-[63] 
[CITE@en[[[RFC 3236]] - The 'application/xhtml+xml' Media Type]] ([TIME[2007-01-14 02:17:27 +09:00]] 版) <https://tools.ietf.org/html/rfc3236>



** RDFa

[38] [[XHTML+RDFa 1.0]] では [CODE(MIME)@en[[[application/xhtml+xml]]]]
を使う[['''べき''']]と規定されていました。

;; [CITE@en[RDFa in XHTML: Syntax and Processing]] ([TIME[2008-10-14 00:17:32 +09:00]] 版) <http://www.w3.org/TR/2008/REC-rdfa-syntax-20081014/#docconf>

* 他の媒体型との関係

[16] XHTML 文書は [[XML]] 文書ですから、
[CODE(MIME)[[[application/xml]]]] や [CODE(MIME)[[[text/xml]]]]
も使えます。
[WEAK[(ただし、 [CODE(MIME)[text/xml]] が適当なことは、 [CODE(MIME)[[[text/[VAR[*]]]]]] の定義上、ほとんどあり得ないでしょう。)]]

特に意識してそう書かれた XHTML 1 文書は従来の意味での 
[[HTML]] 文書でもあります (HTML とも解釈できます) から、
[CODE(MIME)[[[text/html]]]] が使えることもあります。

[CODE(MIME)[application/xhtml+xml]] とこれらの媒体型の使い分けに関しては、
>>1-2 の W3C Note を参照してください。

[12] [[XHTML 1]] の印刷機向けプロファイルである
''XHTML-Print'' <http://www.pwg.org/xhtml-print/HTML-Version/XHTML-Print.html>
は、
[CODE(MIME)[[[application/vnd.pwg-xhtml-print+xml]]]]
という媒体型を使っています。

[17] XHTML 文書は SGML 文書ですから、
[CODE(MIME)[[[application/sgml]]]] や [CODE(MIME)[[[text/sgml]]]]
を使うことも、できなくはありません。

[13] W3C HTML WG は同時に [CODE(MIME)[[[text/xhtml+xml]]]] 
も登録したかったらしいですが、 [[ietf-xml-mime]] WG の猛烈な反対で実現しなかったんだそうです。 ([[MIME]] の [[text/*]] の近視眼的定義のせい。しかし MIME の出来の悪さは色んなところに尾を引くなあ。。。)

[18]
>>12 [[W3C]] は、 [CODE(MIME)[application/vnd.pwg-xhtml-print+xml]] は非推奨で、 [CODE(MIME)[application/xhtml+xml]] を使うようにと言っています。

''XHTML-Print'' <http://www.w3.org/TR/2004/CR-xhtml-print-20040120/#s_conformance>

[64] 
[CODE[application/x-ce-html+xml]],
[CODE[application/ce-html+xml]]

* 実利用例

[65] 
[CITE@ja[application/xhtml+xmlなサイト - 徒委記]], [TIME[2025-11-27T14:32:48.000Z]] <http://www.akatsukinishisu.net/wiki.cgi?application%2Fxhtml%2Bxml%A4%CA%A5%B5%A5%A4%A5%C8>

(これ自体は [CODE[text/html]])

** もし本当に [CODE(MIME)@en[[[application/xhtml+xml]]]] の文書があったら紹介する

[36] [[MathML]] のために使ってるのは [[MathML in the wild]] を参照。
[[RDFa]] を使っているものは [[RDFa]] の項を参照。

[54] 一部の[[ガラケー]]向けには、[[MIME型]]が機能スイッチとなっているため、
[CODE(MIME)@en[[[application/xhtml+xml]]]] で[[文書]]を提供することがありました。

;; 対応しない機種もあるため、 [CODE(HTTP)@en[[[User-Agent:]]]]
により [CODE(MIME)@en[[[text/html]]]] と切り替えるのが普通でした。

;; [CODE(MIME)@en[[[application/xhtml+xml]]]] であるからといって、
[[整形式]]とは限りません。

[32] [CITE[POWDER - Protocol for Web Description Resources: Draft HTML meta data profile]] ([TIME[2008-07-31 14:13:41 +09:00]] 版) <http://www.w3.org/2007/11/powder-profile>:
[[XHTML 1.0]] [[移行用DTD]]

[33] [CITE[ちょっとしたメモ - RSS 1.0のchannel要素のrdf:about]] ([TIME[2008-05-28 09:21:23 +09:00]] 版) <http://www.kanzaki.com/memo/2004/02/05-1>
[[XHTML 1.0]] [[厳密DTD]]

2008年11月現在、[[escape]] されていない [CODE(char)[[[<]]]] があるため、非[[整形式]]。
昔は普通に見れたような気がするので、元々は [CODE(MIME)@en[[[text/html]]]] だったのですかね?

[TIME[2009-03-15T03:20:31.100Z]]現在、未だ修正されていません。誰も (著者すらも) 見てないってことですかね?

[34] [CITE@ja[第 7 回アルゴリズムイントロダクション輪講会資料: Days on the Moon]] ([TIME[2008-12-10 07:52:29 +09:00]] 版) <http://nanto.asablo.jp/blog/2008/12/04/3992000>

[[XHTML 1.1]] + [[MathML 2.0]]

[35] [CITE@ja[もずはっく日記目次 - WebStudio]] ([TIME[2006-05-21 01:21:17 +09:00]] 版) <http://www.d-toybox.com/studio/weblog/index.xhtml>
[[XHTML 1.0]]

;; [CITE@ja[application/xhtml+xmlで提供されるコンテンツについて - WebStudio]] ([TIME[2007-11-28 12:59:50 +09:00]] 版) <http://www.d-toybox.com/studio/detailofmime.html>
これ自体は [CODE(MIME)@en[[[text/html]]]]。

[37] [CITE@en[And with all that | Burningbird]] ([TIME[2009-01-24 17:54:10 +09:00]] 版) <http://realtech.burningbird.net/and-all>

[[RDFa]]、[[SVG]]。

[REFS[
- [44] [CITE@ja[チューリングマシンの万能性と万能チューリングマシンについて]] ([TIME[2011-11-15 09:53:21 +09:00]] 版) <http://metanest.jp/tm/tm.xhtml>
]REFS]

[REFS[
- [46] [CITE@en[Character Repertoire Description Language (CREPDL)]] ([TIME[2009-01-07 02:39:15 +09:00]] 版) <http://www.asahi-net.or.jp/~eb2m-mrt/crepdl/ns/structure/1.0/index.xml>
]REFS]

;; [[XHTML]] + [[RDDL]]

[47] [CITE@en[Mozilla position: Requirements for a framework for mixed-namespace documents]] ([TIME[2007-03-13 09:07:39 +09:00]] 版) <http://dbaron.org/cdi-req/>

[REFS[
- [48] [CITE@ja[クロスルート証明書って何? - '''['''2013/02/11''']''']] ([TIME[2015-04-03 01:03:16 +09:00]] 版) <http://brenhilt.com/tech/2013/0211>
- [53] [CITE@ja[このウェブサイトについての技術文書]] ([[Masashi Nakanishi]] 著, [TIME[2015-07-24 12:00:28 +09:00]] 版) <http://ofmind.net/technical-note>
]REFS]

[57] [CITE@ja[新日本書紀 Kindle版第一巻]] ([TIME[2016-02-01 13:36:17 +09:00]] 版) <http://history-jp.net/right-01.xhtml>

;; [CODE(HTTP)@en[[[Content-Type:]] [[application/xhtml+xml]]]]

[58] [CITE@ja[JabRefにおけるXMPメタデータ サポート]] ([TIME[2016-05-20 10:16:52 +09:00]]) <http://jabref.sourceforge.net/help/ja/XMPHelp.php>


[68] 
[CITE@ja[TRON Code Utility]], [TIME[2012-08-05T09:11:08.000Z]], [TIME[2026-01-14T14:14:51.274Z]] <http://metanest.jp/tcu/tcu.xhtml>

* メモ

[19]
[[Gecko]] では、 [CODE(MIME)[[[application/xhtml+xml]]]]
な[[実体]]の[[根要素]]に [CODE(XMLa)[[[xmlns]]]] [[属性]]がないと 
(つまり [CODE(XMLe)[[QN[xhtml1:html] [http://www.w3.org/1999/xhtml]]]]
になっていないと) [[スタイル・シート]]なしの [[XML文書]]として処理するようです
[WEAK[([CODE(XML)[[[xml-stylesheet]]]] [[処理指令]]があれば、それによる)]]。
[[文書型宣言]]があっても [[Gecko]] は基本的には処理しないので、
[CODE(XMLa)[[[xmlns]]]] [[属性]]がどうしても必要になります。

参考: [CITE[Test about xmlns]] 
<http://www.fairyland.to/soft/browser/xmlns-test>

([[名無しさん]] [sage] [WEAK[2005-05-18 07:55:16 +00:00]])

[20]
最近は[[Google]]も[CODE(MIME)@en[[[application/xhtml+xml]]]]に一応対応したみたいですねぇ。
検索対象に入っているみたいですし、[[キャッシュ]]を出させると怪しげな物理マーク ([CODE(HTMLe)@en[[[font]]]] とか) に変換されたのが出てきます。

[[名前空間URI]]は見ていないようで、[[XHTML 2]]でも[[XHTML 1]]的に解釈したらしい変換結果になっています。。。
([[名無しさん]] [WEAK[2006-01-02 10:50:05 +00:00]])

[21]
>>20 [CODE(MIME)@en[[[application/xhtml+xml]]]]に限らず、[[XML]]ならなんでもそんな感じのようです。。。
([[名無しさん]] [WEAK[2006-01-03 06:39:43 +00:00]])

[22]
[CITE[Mozilla Web Author FAQ]] <http://www.mozilla.org/docs/web-developer/faq.html#accept>

> The preference for application/xhtml+xml was added to the Accept header in order to enable the serving of MathML to both Mozilla and IE with Apache without scripting back when the MathPlayer plug-in for IE did not handle application/xhtml+xml.

([[名無しさん]])

[23]
[CITE[Bug 9677 - '''['''S60''']''' application/xhtml+xml doesn't get XML treatment]] ([CODE[2007-01-24 21:54:50 +09:00]] 版) <http://bugs.webkit.org/show_bug.cgi?id=9677>
([[名無しさん]])

[24]
[CITE[Google]] ([CODE[2007-01-24 21:55:56 +09:00]] 版) <http://www.google.com/xhtml>

[[Firefox]] 1.5 からアクセスすると、

>
[PRE(HTML example code)[
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Cache-Control" content="no-cache"/
[INS[(略)]]
]PRE]

という内容で [CODE(MIME)@en[[[text/html]]]]
でした。
([[名無しさん]] [WEAK[2007-01-24 12:57:19 +00:00]])

[25]
[CITE@en[Getting IE to accept application/xhtml+xml]] ([[Steven Pemberton]] 著, [CODE[2007-04-19 19:40:00 +09:00]] 版) <http://lists.w3.org/Archives/Public/public-xhtml2/2007Apr/0015.html>
([[名無しさん]])

[26]
[CITE[IEがapplication/xhtml+xmlに対応しない理由:メモランダム]] ([CODE[2007-05-07 07:37:40 +09:00]] 版) <http://mynotes.jp/blog/2007/05/why_ie_doesnt_support_application_xhtml_plus_xml>
([[名無しさん]] [WEAK[2007-06-09 16:59:58 +00:00]])

[27]
[CITE[XML - Extensible Markup Language]] ([CODE[2007-03-10 11:04:55 +09:00]] 版) <http://msugai.fc2web.com/web/XHTML11/xml.html>

[CODE(HTMLa)@en[[[http-equiv]]]] での使用を紹介した例。
この[[文書]]自体でもそれを使っている。
[[XHTML 1.1]] [[文書]]。でも
[CODE(HTTP)@en[[[Content-Type]]]]
は [CODE(MIME)@en[[[text/html]]]]。
([[名無しさん]])

[28]
[CITE[&#65402;&#65402;&#65435;&#65400;&#65438;&#65413;&#65419;&#65438;]] ([CODE[2007-06-11 00:12:30 +09:00]] 版) <http://m-cocolog.jp/m/index.xhtml>

[CODE(MIME)@en[[[application/xhtml+xml]]]]。
それはいいのだが、
[PRE(HTML bad code)[
<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE html PUBLIC "-//i-mode group (ja)//DTD XHTML i-XHTML(Locale/Ver.=ja/2.0) 1.0//EN" "i-xhtml_4ja_10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja">
<head>
<meta http-equiv="Cache-Control" content="no-cache" />
<meta name="description" content="&#65402;&#65402;&#65435;&#65400;&#65438;&#65413;&#65419;&#65438;" />
<meta name="keywords" content="&#65402;&#65402;&#65435;&#65400;&#65438;&#65413;&#65419;&#65438;" />
<meta http-equiv="ContentType" content="application/xhtml+xml" />
]PRE]

こんな[[文書型宣言]]なもんだから、 [[Firefox]]
1.5 は [CODE(XML)@en[&[[nbsp]];]] が現れたところで[Q@ja[定義されていない実体が使用されています。]]といって表示してくれない。

それにしても
[PRE(HTML bad code)[
<meta http-equiv="ContentType" content="application/xhtml+xml" />
]PRE]

はいったいなにがしたいのか。
([[名無しさん]])

[29]
>>28 閉じられていない [CODE(HTMLe)@en[[[img]]]] [[要素]]がいくつかある。乙。

;; 気づかないということは、 [[iモード]]上の [[Webブラウザ]]はやっぱり[[XML]]
[[構文解析器]]ではないのでしょう。やっぱり。

([[名無しさん]])

[30]
[CITE[Mai multe produse Google]] ([CODE[2008-01-09 05:50:36 +09:00]] 版) 
(Served as [CODE(MIME)@en[[[text/html]]]])
<http://www.google.ro/intl/ro/options/>

>
[PRE(HTML bad example code)[
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
]PRE]

([[名無しさん]])

[31]
[CITE[HEMiDEMi - 黑米共享書籤]] ([[HEMiDEMi]] 著, [TIME[2008-06-21 21:09:01 +09:00]] 版) <http://www.hemidemi.com/member/signin_form?_url=%2Fuser_bookmark%2Fnew>
([CODE(MIME)@en[[[text/html]]]]

>
[PRE(HTML bad example code)[
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>HEMiDEMi - 黑米共享書籤</title>
 
 <!-- Meta Tags -->
 <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
]PRE]

([[名無しさん]])



[39] [CITE@en[(X)HTML5 Tracking]]
([TIME[2009-08-08 01:15:33 +09:00]] 版)
<http://html5.org/tools/web-apps-tracker?from=3551&to=3552>

[40] [CITE[X3DOM 1.0 - home]] ([TIME[2010-01-01 12:47:33 +09:00]] 版) <http://www.x3dom.org/?page_id=5>

[41] [CITE@en[(X)HTML5 Tracking]]
([TIME[2010-01-05 10:48:34 +09:00]] 版)
<http://html5.org/tools/web-apps-tracker?from=4458&to=4459>

[42] [CITE[''''''[''''''ietf-types'''''']'''''' Update to application/xhtml+xml media type]]
( ([TIME[2012-08-07 11:52:14 +09:00]] 版))
<http://www.ietf.org/mail-archive/web/ietf-types/current/msg01709.html>

[43] [CITE@ja[Karl Dubost - Wrong To Be Right - application/xhtml+xml]]
( ([TIME[2012-08-12 10:52:33 +09:00]] 版))
<http://my.opera.com/karlcow/blog/2011/03/03/wrong-to-be-right-with-xhtml>

[45] [CITE@en[Web Applications 1.0 r3552 Include MIME type registration sections.]]
( ([TIME[2009-08-07 18:44:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=3551&to=3552>

[49] [CITE@en[1180623 – Stop choking at badly formatted application/xhtml+xml documents]]
([TIME[2015-07-07 11:05:51 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=1180623>

[50] [CITE@en[Issue 1347: gmail.com - mobile site is not usable - webcompat.com]]
([TIME[2015-07-07 11:06:14 +09:00]] 版)
<https://webcompat.com/issues/1347>

[51] [CITE@en[1036987 – XML Parsing error: not well-formed when trying to reply to an email through the Gmail web interface on Firefox OS]]
([TIME[2015-07-07 11:08:10 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=1036987>

[FIG(quote)[
[FIGCAPTION[
[52] [CITE@en[Dev.Opera — No More “XML Parsing Failed” Errors]]
([TIME[2015-07-02 01:51:00 +09:00]] 版)
<https://dev.opera.com/blog/no-more-xml-parsing-failed-errors/>
]FIGCAPTION]

> Over the last couple of years, we've contacted all sites we found are breaking like this, and asked Microsoft to fix the ASP.NET sniffing problem, which they've done. However, as the rollout of this update takes time, there are still a number of sites broken, and it seems like this situation will be with us for quite some time to come.
> Hence, we've decided to stop throwing draconian XML parsing failed error messages, and instead, attempt to reparse the document automatically as HTML. Instead of showing an error message in the browser, it's now dumped to the console, so as a developer, you can still find XML parsing error warnings in Opera Dragonfly and the Error Console if you want to.

]FIG]

[FIG(quote)[
[FIGCAPTION[
[55] [CITE[IRC logs: freenode / #whatwg / 20150813]]
([TIME[2015-08-14 18:54:30 +09:00]] 版)
<http://krijnhoetmer.nl/irc-logs/whatwg/20150813>
]FIGCAPTION]

> 
> # '''['''11:38''']''' <annevk> "'''['''T''']'''he reviewer for my registration of application/xhtml+xml in 2014 objected because I was not referring to XHTML 2.0." Thank you darobin, that's comedy gold
> # '''['''11:39''']''' <darobin> annevk: :)
> # '''['''11:39''']''' <darobin> yeah, MikeSmith and I laughed about that for a while
> # '''['''11:39''']''' <darobin> shame the stuff is not public
> # '''['''11:39''']''' <darobin> PLH had to stop me from basically strangling them

]FIG]


[66] 
[CITE@ja[Internet Archive(Wayback Machine)で「Content-Type: application/xhtml+xml」なページの表示がエラーになる件とその回避策(12/7対策を確認したので追記) - n2s アーカイブス]], [TIME[2025-11-27T14:34:06.000Z]] <https://n2s.hatenadiary.jp/entry/20141203/p1>


[67] >>66 最近遭遇した!と思ってよく見ると10年前・・・ どゆことだ!? [TIME[2025-11-27T14:34:45.447Z]]