-
Notifications
You must be signed in to change notification settings - Fork 4
/
481.txt
471 lines (349 loc) · 24.9 KB
/
481.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
[22] [DFN[XML MIME[RUBYB[型]@en[type]]]]は、多くの [[XML]] 関連仕様で [[XML]]
として扱われる[[MIME型]]です。 [CODE(MIME)@en[[[text/xml]]]] と
[CODE(MIME)@en[[[application/xml]]]] の他、 [CODE(MIME)@en[[[+xml]]]]
で終わる[[MIME型]]が該当します。
* 仕様書
[REFS[
- [46] [CITE@en[RFC 7303 - XML Media Types]] ([TIME[2014-07-07 20:56:43 +09:00]] 版) <http://tools.ietf.org/html/rfc7303>
-- [87] [CITE@en[RFC 7303 - XML Media Types]] ([TIME[2014-07-07 20:56:43 +09:00]] 版) <http://tools.ietf.org/html/rfc7303#section-4.1>
-- [89] [CITE@en[RFC 7303 - XML Media Types]] ([TIME[2014-07-07 20:56:43 +09:00]] 版) <http://tools.ietf.org/html/rfc7303#section-4.2>
-- [96] [CITE@en[RFC 7303 - XML Media Types]] ([TIME[2014-07-07 20:56:43 +09:00]] 版) <http://tools.ietf.org/html/rfc7303#section-4.3>
-- [102] [CITE@en[RFC 7303 - XML Media Types]] ([TIME[2014-07-07 20:56:43 +09:00]] 版) <http://tools.ietf.org/html/rfc7303#section-9.1>
-- [103] [CITE@en[RFC 7303 - XML Media Types]] ([TIME[2014-07-07 20:56:43 +09:00]] 版) <http://tools.ietf.org/html/rfc7303#section-9.6>
- [29] <http://www.whatwg.org/specs/web-apps/current-work/complete.html#xml-mime-type>
- [93] [CITE@en[RFC 6838 - Media Type Specifications and Registration Procedures]] ([TIME[2014-06-02 03:57:09 +09:00]] 版) <http://tools.ietf.org/html/rfc6838#section-4.7>
- [8] [CITE@en[RFC 4918 - HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)]] ([TIME[2014-09-21 17:04:59 +09:00]] 版) <http://tools.ietf.org/html/rfc4918#section-8.2>
- [15] [CITE[MIME Sniffing Standard]] ([TIME[2016-03-05 01:29:10 +09:00]] 版) <https://mimesniff.spec.whatwg.org/#xml-type>
]REFS]
[48] はじめ [[RFC 2376]] で定義されていましたが、改訂され [[RFC 3023]]
となりました。 [[RFC 3023]] への改訂は、長らく素案状態で放置されていましたが、
2014年にようやく [[RFC 7303]] となりました。
* XML MIME 型
[23] [DFN[XML MIME[RUBYB[型]@en[type]]]]は、
[FIG(list short)[
- [CODE(MIME)@en[[[text/xml]]]]
- [CODE(MIME)@en[[[application/xml]]]]
- [CODE(MIME)@en[[[+xml]]]] で終わる[[MIME型]]
]FIG]
です [SRC[>>46]]。
[16] [DFN[[RUBYB[XML型]@en[XML type]]]]は、次のものです [SRC[>>15]]。
[FIG(list)[
- [[構文解析可能MIME型]]であって、[F[部分型]]が [CODE[+xml]] で終わるもの
- [[構文解析可能MIME型]]であって、[F[MIME型部分]]が [CODE(MIME)@en[text/xml]] であるもの
- [[構文解析可能MIME型]]であって、[F[MIME型部分]]が [CODE(MIME)@en[application/xml]] であるもの
]FIG]
;; [17] この両者の定義は同等です。
[33] なお、 [[RFC 3023]] は「[[XML MIME型]]」あるいは「[[XML媒体型]]」
という用語は規定していません。
その題名こそ「XML Media Types」ではありますが、本文中では「XML Media Types」
という用語が登場せず、附属書で「XML MIME Types」が節題として使われているのみです。
[24] [[RFC 3023]] の「XML Media Types」と題した章では [[XML MIME実体]]のための[[MIME型]]として
[CODE(MIME)@en[[[text/xml]]]], [CODE(MIME)@en[[[application/xml]]]],
[CODE(MIME)@en[[[text/xml-external-parsed-entity]]]]、
[CODE(MIME)@en[[[application/xml-external-parsed-entity]]]]、
[CODE(MIME)@en[[[application/xml-dtd]]]] の5つを定義していました [SRC[>>57]]。
[34] [[RFC 4287]] ([[Atom 1.0]]) は「XML media types」を [[RFC 3023]] から引用していますが、
>>33 のような状況なので規定の意味するところが曖昧になっています。
> If the value of "type" is an XML media type [RFC3023] or ends with "+xml" or "/xml" (case insensitive)
のような記述がわざわざあるので、これを定義とみなすなら、[[Web Applications 1.0]] の >>23
の定義よりはやや広いことになります。
[35] [[HTML Standard]] (旧 [[Web Applications 1.0]]、[[HTML5]]) は「XML MIME Types」を >>23
のように正確に定義しています。
* MIME 型 [CODE(MIME)@en[[[application/xml]]]], [CODE(MIME)@en[text/xml]]
[64] [DFN[[CODE(MIME)@en[[[application/xml]]]]]] と [DFN[[CODE(MIME)@en[[[text/xml]]]]]] は、
[[XML]] [[文書実体]]の [[MIME型]]です。
[86] [[RFC 3023]] まではどちらが良いともされていなかったようですが、
[[RFC 7303]] では [CODE(MIME)@en[[[application/xml]]]]
を使う[['''べき''']]とされています [SRC[>>87]]。
;; [66] 以前から[[宗教上の理由]]により [CODE(MIME)@en[[[application/xml]]]] を好む人もいました。
;; [88] [CODE(MIME)@en[[[text/*]]]] の [CODE(MIME)@en[[[charset]]]]
[[引数]]が省略された場合の既定値については色々な混乱がありました。 [[RFC 7303]]
は従来の定義を破棄して新たな (より現実的な) 規定となっています。これが
[CODE(MIME)@en[[[text/xml]]]] を使うべきでない理由 [SRC[>>87]] とされています。
[6] [[XML]] を利用した[[マーク付け言語]]によっては、 [CODE(MIME)@en[[[text/xml]]]]
と [CODE(MIME)@en[[[application/xml]]]] のどちらを使うべきか限定していることがあります。
[9] [[WebDAV]] における [[XML]] は [CODE(MIME)@en[[[application/xml]]]]
を使う[['''べき''']]であり、 [CODE(MIME)@en[[[text/xml]]]]
は[[非推奨]]です [SRC[>>8]]。しかしどちらも対応しなければ[['''なりません''']] [SRC[>>8]]。
[7] [[oEmbed]] は [CODE(MIME)@en[[[text/xml]]]] を使うことを要求しています。
[FIG(quote)[
[FIGCAPTION[
[63] [[ECMA-376]] Second Edition, Part 1, 15.2.4
]FIGCAPTION]
>If no explicit MIME type exists for a specific XML format, text/xml shall be used. Consumers
who read a value of text/xml should determine the contents by the root namespace of the
contents of the part.
]FIG]
* [CODE(MIME)@en[*/*+xml]] 構造化構文接尾辞 (MIME)
[30] [[構造化構文接尾辞]] [CODE(MIME)@en[[[xml]]]] は、 [[XML]] [[文書実体]]を表しています。
すなわち、 [CODE(MIME)@en[[[+xml]]]] で終わる [[MIME型]]は、
[[XML]] を基にした形式であることを表しています。
この[[構造化構文接尾辞]]は [[RFC 3023]] で導入され、現在は [[RFC 7303]] [SRC[>>103]]
で定義されています。
[EG[
[95] 例えば [[XHTML]] の [[MIME型]]は [CODE(MIME)@en[[[application/xhtml'''+xml''']]]]、
[[SVG]] の [[MIME型]]は [CODE(MIME)@en[[[image/svg'''+xml''']]]] です。
]EG]
[90] [[XML]] を基にした形式に新しく [[MIME型]]を用意するときは、
[CODE(MIME)@en[[[+xml]]]] で終わる名前とする[['''べき''']]です。
ただし、一般の [[XML]] としての処理が何か不都合な場合はこの限りではありません。 [SRC[>>89]]
[101] 特に、[[素片識別子]]として [[XPointer Framework]] と
[CODE(XPointerScheme)@en[[[element()]]]] [[XPointer scheme]] を使うのが不適切な場合は、
[CODE(MIME)@en[[[+xml]]]] で終わる[['''べきではありません''']] [SRC[>>46]]。
[91] [[応用]]は、 [CODE(MIME)@en[[[+xml]]]] で終わる [[MIME型]]なら
[[XML文書]]であるとみなして [[XML]] の処理を実行できます [SRC[>>89]]。
[94] [CODE(MIME)@en[[[+xml]]]] で終わる [[MIME型]]の登録について [[RFC 7303]]
は [[RFC 6838]] ([[MIME型]]の登録手続き) を参照しています [SRC[>>89]]。しかし [[RFC 6838]]
は [[RFC 3023]] ([[RFC 7303]]) を参照するだけで、実質的な規定を含んでいません [SRC[>>93]]。
本来の意図は不明ですが、 [[RFC 7303]] の記述によると、
[[IANA]] 登録時に [[XML]] ベースの形式は [CODE(MIME)@en[[[+xml]]]]
を使うよう [[Media Reviewer]] が注意するべきである、
[[XML MIME実体]]を表す[[MIME型]]のみが [CODE(MIME)@en[[[+xml]]]]
で終わる形で登録して良い、となっています [SRC[>>89]]。
[11] [CODE(MIME)@en[[[+xml]]]] で終わる[[MIME型]]の例:
[FIG(middle list)[
- [CODE(MIME)@en[[[application/xhtml+xml]]]]
- [CODE(MIME)@en[[[image/svg+xml]]]]
- [CODE(MIME)@en[[[application/xslt+xml]]]]
- [CODE(MIME)@en[[[application/atom+xml]]]]
- [CODE(MIME)@en[[[application/rss+xml]]]]
- [CODE(MIME)@en[[[application/rdf+xml]]]]
]FIG]
** RFC 3023 を参照しない XML MIME 型
[32] [CODE(MIME)@en[[[+xml]]]] で終わる [[MIME型]]は普通 [[RFC 3023]] を引用していますが、
中にはそうでないものもあります。
[FIG(list)[
- [28] [CODE(MIME)@en[[[application/owl+xml]]]]
-- 参照まったくなし
-- [CODE(MIME)@en[[[charset]]]] の定義は曖昧
-- [[素片識別子]]の定義なし
]FIG]
* [CODE(MIME)@en[+xml]] で終わらない XML の MIME 型
[31] [[RFC 3023]] 以前に使われ始めた [[MIME型]]や独自に決められた[[MIME型]]は、[CODE(MIME)@en[[[+xml]]]]
が最後についていません。これらは定義上、「[[XML MIME型]]」ではありません。
[98] 更に [[RFC 7303]] は、 [[XML]] としての一般的な処理が好ましくない場合は
[CODE(MIME)@en[[[+xml]]]] で終わらない [[MIME型]]を使うべきであるとしています。
[99] [CODE(MIME)@en[[[+xml]]]] で終わらない [[XML]] の[[MIME型]]としては次のものが知られています。
[FIG(list short)[
- [CODE(MIME)@en[[[text/xsl]]]]
- [CODE(MIME)@en[[[application/smil]]]]
- [CODE(MIME)@en[[[text/x-cross-domain-policy]]]]
- [CODE(MIME)@en[[[text/xul]]]]
- [CODE(MIME)@en[[[text/cdf]]]]
- [CODE(MIME)@en[[[text/x-cdf]]]]
- [CODE(MIME)@en[[[text/rdf]]]]
- [CODE(MIME)@en[[[application/cdf]]]]
- [CODE(MIME)@en[[[application/x-cdf]]]]
]FIG]
[44] >>43 には >>31 も含む [[XML]] [[文書]]の [[MIME型]]の一覧があります。
[REFS[
- [43] [CITE[data-web-defs/data/mime-types.json at master · manakai/data-web-defs]] ([TIME[2014-03-23 04:57:03 +09:00]] 版) <https://github.com/manakai/data-web-defs/blob/master/data/mime-types.json>
]REFS]
[77] [[XHTML]] や [[RSS]] が誤って [CODE(MIME)@en[[[text/html]]]], [CODE(MIME)@en[[[text/plain]]]],
[CODE(MIME)@en[[[application/octet-stream]]]] のような他の[[MIME型]]で送信されることもあります。
[[MIME Sniffing]] はそのような誤った[[MIME型]]の一部を訂正する[[アルゴリズム]]を規定しています。
;; [78] 歴史的には [CODE(MIME)@en[[[text/html]]]] を場合によって [[XML]] ([[XHTML]])
として処理する[[利用者エージェント]]も存在しましたが、現在では正しくないと考えられています。
[[RSS]] として処理する場合は現在も残っています。
* 文書実体以外の MIME 型
[76] [[XML]] 関連の [[MIME型]]としては他に次のものがあります。
[FIG(list)[
- [CODE(MIME)@en[[[text/xml-external-parsed-entity]]]] ([[外部一般解析対象実体]])
- [CODE(MIME)@en[[[application/xml-external-parsed-entity]]]] ([[外部一般解析対象実体]])
- [CODE(MIME)@en[[[application/xml-dtd]]]] ([[外部部分集合実体]]、[[外部引数実体]])
]FIG]
* 引数
[58] [CODE(MIME)@en[[[text/xml]]]] には次の[[引数]]があります。
[FIG(list short)[
- [CODE(MIME)@en[[[charset]]]]
- [CODE(MIME)@en[[[subtype]]]]
]FIG]
[67] [CODE(MIME)@en[[[application/xml]]]] には次の[[引数]]があります。
[FIG(list short)[
- [CODE(MIME)@en[[[charset]]]]
]FIG]
[68] [CODE(MIME)@en[[[*/*+xml]]]] [[構造化構文接尾辞]]共通の[[引数]]はありません。
しかし、一貫性のため [CODE(MIME)@en[[[charset]]]] [[引数]]を定義する[['''べき''']]です
[SRC[>>89]]。
;; [92] [[UTF-8]] や [[UTF-16]] しか使わないような場合には、 [CODE(MIME)@en[[[charset]]]]
[[引数]]は必要ありません [SRC[>>89]]。
[97] [CODE(MIME)@en[[[+xml]]]] で終わらない [[XML]] の[[MIME型]]を[[IANA]]
に登録する場合、 [CODE(MIME)@en[[[charset]]]] [[引数]]を定義する[['''べき''']]です [SRC[>>96]]。
その定義は [[RFC 7303]] を参照する[['''べき''']]です [SRC[>>96]]。
** [CODE(MIME)@en[charset]] 引数
[25] 多くの [[XML MIME型]]は [CODE(MIME)@en[[[charset]]]] [[引数]]があり、
[[RFC 3023]]/[[RFC 7303]] の定義によるとされています。詳しくは [[charset]]
の項をご覧ください。
[EG[
[REFS[
- [61] [CITE[My Last.fm -Last.fmで音楽を楽しもう-]] ([CODE[2007-09-24 13:30:31 +09:00]] 版) <http://lastfm.techno-st.net/atom.xml>
]REFS]
[[HTTP]] [CODE(HTTP)@en[[[Content-Type]]:]] には
[CODE(MIME)@en[[[text/xml]]]] とだけあります。
[[実体本体]]は [[UTF-8]] の [[XML]] [[文書実体]]で、
[[XML宣言]]に [CODE(charset)@en[[[UTF-8]]]]
と書かれています。
]EG]
[EG[
[REFS[
- [62] [CITE[FAQ@hiro. '''['''Atom feed''']''']] ([TIME[2007-09-24 13:43:47 +09:00]] 版) <http://potato.chips.jp/atom.xml>
]REFS]
>>61 と同じ (こちらは [[Atom 0.3]])。
]EG]
[100] 処理モデルは[[XMLにおける文字コード]]を参照してください。
* 素片識別子
[26] 多くの [[XML MIME型]]では[[素片識別子]]は [[RFC 3023]] や [[XPointer]]
の定義によるとされています。詳しくは[[素片識別子]]の項をご覧ください。
* 性質
[12] [[XML MIME型]]の性質を表す語として次のものがあります。
[FIG(short list)[
- [[明示的対応XML型]]
]FIG]
* 歴史
** RFC 2376
[50] [DFN[[[RFC 2376]]]] は [CODE(MIME)@en[[[text/xml]]]] と
[CODE(MIME)@en[[[application/xml]]]] を定義していました。
[CODE(MIME)@en[[[application/xml]]]] はどんな [[XML実体]]
([[文書実体]]、[[外部部分集合実体]]、[[外部解析対象実体]]、
[[外部引数実体]]) にも使うことができ、
[CODE(MIME)@en[[[text/xml]]]] は [CODE(MIME)@en[[[text/*]]]]
の制約を ([[MIME]] で使うときは) 受けるとsらえていました [SRC[>>49]]。
[52] どちらにも [CODE(MIME)@en[[[charset]]]] [[引数]]があり、
省略可能であるものの'''強く[[推奨]]''' [SRC[>>49]] されていました。
しかしその[[値域]]はなぜか明記されていませんでした。
[53] [[UTF-8]] と [[UTF-16]] が特に推奨されていますが、 [[MIME]]
では [CODE(MIME)@en[[[text/xml]]]] で [[UTF-16]] を使えないことになっていました [SRC[>>49]]。
;; [55] [[HTTP]] から [[MIME]] へ変換する場合には、 [[UTF-16]] なら
[CODE(MIME)@en[[[text/xml]]]] から [CODE(MIME)@en[[[application/xml]]]]
に変更しなければ[['''ならない''']]とされていました [SRC[>>49]]。
[54] [CODE(MIME)@en[[[text/xml]]]] における[[既定値]]は [[MIME]] でも [[HTTP]]
でも [CODE(charset)@en[[[us-ascii]]]] で、 [CODE(MIME)@en[[[application/xml]]]]
では[[既定値]]を仮定するべきではないとされていました [SRC[>>49]]。
なぜか仮定することを禁止はされていませんでした。
[51] 特定の[[XML応用]]の [[MIME型]]が必要なら [[RFC 2376]]
を基にするべきである [SRC[>>49]] とは述べているものの、
そのための特別な仕組みは用意されていませんでした。
[REFS[
- [49] [CITE@en[RFC 2376 - XML Media Types]] ([TIME[1998-07]] 版) <http://tools.ietf.org/html/rfc2376>
]REFS]
** RFC 3023
[72] 第2世代である [[RFC 3023]] では、新規に多くの [[MIME型]]が追加され、
既存の[[MIME型]]の意味も狭く変更されました。
[73] [CODE(MIME)@en[[[text/xml]]]] と [CODE(MIME)@en[[[application/xml]]]]
は[[文書実体]]のための [[MIME型]]とされ、
[[文書実体]]としても[[外部解析対象実体]]としても使える場合を除き、
[[文書実体]]以外の[[実体]]に使うことは禁止されました [SRC[>>57]]。
[74] [[外部部分集合実体]]や[[外部解析対象実体]]には新たに
[CODE(MIME)@en[[[text/xml-external-parsed-entity]]]]、
[CODE(MIME)@en[[[application/xml-external-parsed-entity]]]]、
[CODE(MIME)@en[[[application/xml-dtd]]]]
が追加されました [SRC[>>57]]。
;; 詳細はそれぞれの項を参照。
[75] 特定の[[XML応用]]の[[MIME型]]が必要なら [[RFC 3023]]
を基にするべきとの規定 (>>51) は引き続き存在し、
特に [CODE(MIME)@en[[[charset]]]] [[引数]]は [[RFC 3023]]
と同じ形で使うことが[['''推奨''']]されていました [SRC[>>57]]。
[80] 対象がより限定されたのを除けば、 [CODE(MIME)@en[[[text/xml]]]]、
[CODE(MIME)@en[[[application/xml]]]]、[CODE(MIME)@en[[[charset]]]]
の定義は [[RFC 2376]] とほぼ同様でした。
[82] [[RFC 3023]] は更に、[[構造化構文接尾辞]] [CODE(MIME)@en[[[+xml]]]]
を定義していました。 [[XML]] ベースの書式の
[[MIME型]]はこの[[構造化構文接尾辞]]を使う[['''べき''']]であること、
[[XML]] 以外の[[MIME型]]をこの[[構造化構文接尾辞]]で [[IANA]]
に登録しては[['''ならない''']]こと、 [[RFC 3023]] を参照した形の
[CODE(MIME)@en[[[charset]]]] [[引数]]を定義する[['''べき''']]ことなどを規定していました。
[REFS[
- [57] [CITE@en[RFC 3023 - XML Media Types]] ([TIME[2014-07-11 12:46:44 +09:00]] 版) <http://tools.ietf.org/html/rfc3023#section-3>
- [81] [CITE@en[RFC 3023 - XML Media Types]] ([TIME[2014-07-11 12:46:44 +09:00]] 版) <http://tools.ietf.org/html/rfc3023#section-7>
]REFS]
[83] [CODE(MIME)@en[[[+xml]]]] は最初の[[構造化構文接尾辞]]で、
当時は「[[構造化構文接尾辞]]」という概念もまだありませんでした。
その後 [[RFC 6839]] によって[[構造化構文接尾辞]]が定義された時に、
[[RFC 3023]] に基づき[[素片識別子]]の解釈を補って [[IANA]]
に登録されています [SRC[>>84]]。
[REFS[
- [84] [CITE@en[RFC 6839 - Additional Media Type Structured Syntax Suffixes]] ([TIME[2014-07-07 20:29:23 +09:00]] 版) <http://tools.ietf.org/html/rfc6839#section-4.1>
]REFS]
** RFC 7303
[104] [[RFC 7303]] は [[RFC 3023]] の13年ぶりの改訂版です。
改訂作業は比較的早くから行われていましたが、半ば放置された状態で10年以上経過し、
2014年にようやく [[RFC]] として出版されました。
[105] この改訂では[[文字コード]]の判定方法が、 [[RFC 3023]]
当時の [[RFC]] に基づく[[政治的に正しい]]方法に替えて、
より現実に合わせた形に改められています。
;; [[XMLにおける文字コード]]の項も参照してください。
[106] また[[素片識別子]]が実質未定義だった状態から、 [[XPointer]] を参照する形に改められています。
;; [[素片識別子]]の項も参照してください。
* 関連
[79] [[SGML]] には [CODE(MIME)@en[[[text/sgml]]]] や [CODE(MIME)@en[[[application/sgml]]]]
が用意されています。理論上は [[XML文書]]は [[SGML文書]]とみなせるはずですが、
実際には [[XML]] が [[SGML]] の [[MIME型]]で送信されることはなさそうです。
* メモ
[59] なんの説明もなしに、「XML 文書 = 拡張子 [CODE(file)[.xml]] = [[MIME]] [CODE[text/xml]]」のように説明している香具師はアホです。
[60] XML 文書一般に使える媒体型は、 [CODE[text/xml]] のほかに [CODE[[[application/xml]]]] があります。そして''後者が一般形''です。ですから、どちらを使えば良いのかわからない人は ''[CODE[application/xml]]'' を使うほうが安全です。 ([CODE[text/xml]] の方が適切なことはほとんどありません。)
[69] [[名前空間]]のある [[XML]] 文書には [[MIME]] [[媒体型]]は無力だとかで、 XML 文書はすべからく [WEAK[[CODE[[VAR[*]]/[VAR[*]]+xml]] ではなく]] [CODE[application/xml]] を使うべき、みたいな風潮があることに悪寒を感じます。
[70] 確かに名前空間を使うと XHTML と SVG の混ざった文書が作れます。だけど、それは XHTML が主の文書がなくなることも、 SVG が主の文書がなくなることも意味しない。依然 [CODE[application/xhtml+xml]] と [CODE[image/svg+xml]] の区別の意義は存在するはずです。どっちとも判断しがたい、文章と図が半々に混在した文書なら、そのときはじめて [CODE[application/xml]] の出番でしょう。だってそれは単なる XHTML とも単なる SVG とも違った使われ方を求めているんだから。
[71] 確かに媒体型の仕組みで伝え得る情報は不十分です。 [[CC/PP]] とか、他の仕組みも必要なのは事実。だけどそれは媒体型をないがしろにしてもいいことは意味しません。媒体型の支配する世界にいる限りは。
- [1] なんか、 [[XML]] の応用マーク付け言語系が増えるに従って [CODE[[VAR[*]]/[VAR[*]]+xml]] という[[媒体型]]名が増えて実装の対応が大変だからよくないんじゃ? とかあふぉなこと言ってる香具師がいるらしいですが・・・。
- [2] なんで [CODE[[[+xml]]]] なんてへんちくりんな接尾辞がついたんだかわかんないのかな? わかんないんだろーなー
- [3] 確かに、全部 [CODE[[[application/xml]]]] (あるいは + [[conneg]]) でいいじゃん?派もいることはいるけどねぇ。
- [4] >>3 でもあの [[ietf-xml-mime]] の大論争の結果があの [[RFC]] なわけで。
- [5] [CODE[application/[VAR[なんたら]]+rdf+xml]] 期待 age
[27] >>1-2 でもまあ、共通の処理モデルが [[RFC 3023]] とかで定義されていない以上、
仕方がない気もするわな。 [[RFC 3023]] って実際実装側にとって有意義なことほとんど書いてないじゃん。
[21]
[CITE[Bug 155730 – Mozilla doesn't handle files served as */*+xml as XML files]] ([CODE[2007-02-10 14:34:20 +09:00]] 版) <https://bugzilla.mozilla.org/show_bug.cgi?id=155730>
[36] [CITE@en[draft-murata-kohn-lilley-xml-03 - XML Media Types]]
([TIME[2009-09-25 02:28:26 +09:00]] 版)
<http://tools.ietf.org/html/draft-murata-kohn-lilley-xml>
[37] [CITE@en[Web Applications 1.0 r6661 Make the */*+xml handling be fallback handling, rather than overriding any registered handlers for specific XML types.]]
( ([TIME[2011-10-12 08:05:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=6660&to=6661>
[38] [CITE@EN[W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures]]
( ([TIME[2012-04-05 06:34:07 +09:00]] 版))
<http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/#web-representation>
[39] [CITE@en-US[XBL 2.0]]
( ([TIME[2012-05-03 02:23:03 +09:00]] 版))
<http://dev.w3.org/2006/xbl2/Overview.html#xml-mime-type>
[40] [CITE@en[draft-ietf-appsawg-xml-mediatypes-01 - XML Media Types]]
( ([TIME[2013-05-29 10:17:41 +09:00]] 版))
<http://tools.ietf.org/html/draft-ietf-appsawg-xml-mediatypes-01>
[41] [CITE@en[RFC 6839 - Additional Media Type Structured Syntax Suffixes]]
( ([TIME[2013-06-28 00:23:48 +09:00]] 版))
<http://tools.ietf.org/html/rfc6839#section-4.1>
[42] [CITE@en-US[XML Binding Language (XBL) 2.0]]
( ([TIME[2007-03-16 22:20:16 +09:00]] 版))
<http://www.w3.org/TR/2007/CR-xbl-20070316/#xml-mime>
[45] [CITE@en[RFC 7252 - The Constrained Application Protocol (CoAP)]]
( ([TIME[2014-06-27 00:59:37 +09:00]] 版))
<http://tools.ietf.org/html/rfc7252#page-93>
[47] [CITE[Index of /2006/02/son-of-3023]]
([TIME[2009-12-02 08:29:49 +09:00]] 版)
<http://www.w3.org/2006/02/son-of-3023/>
[85] [CITE@en[Re: ''''''[''''''apps-discuss'''''']'''''' Last Call: <draft-ietf-appsawg-xml-mediatypes-09.txt> (XML Media Types) to Proposed Standard]]
( ([[Paul Grosso]] 著, [TIME[2014-03-04 04:35:44 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-xml-core-wg/2014Mar/0003.html>
[107] [CITE[OASIS Open Document Format for Office Applications (OpenDocument) Version 1.2 - Part 1: OpenDocument Schema]]
( ([TIME[2011-09-29 13:00:00 +09:00]] 版))
<http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1420348_2538929491>
[FIG(quote)[
[FIGCAPTION[
[10] [CITE[OASIS Open Document Format for Office Applications (OpenDocument) Version 1.2 - Part 1: OpenDocument Schema]]
([TIME[2011-09-29 13:00:00 +09:00]] 版)
<http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1420348_2538929491>
]FIGCAPTION]
> Office documents that conform to this specification but are not contained in a package should use the MIME type text/xml.
]FIG]
[13] [CITE@en[155730 – (*/*+xml) Mozilla doesn't handle files served as */*+xml as XML files]]
([TIME[2015-09-30 23:18:34 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=155730>
[FIG(quote)[
[FIGCAPTION[
[14] [CITE@en[RFC 6546 - Transport of Real-time Inter-network Defense (RID) Messages over HTTP/TLS]]
([TIME[2016-01-08 21:27:35 +09:00]] 版)
<https://tools.ietf.org/html/rfc6546>
]FIGCAPTION]
> As RID documents are XML,
> the RID media type is 'text/xml'; i.e., the 'Content-type' Request
> and Response headers MUST be 'text/xml'.
]FIG]