/
636.txt
339 lines (243 loc) · 13.5 KB
/
636.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
* Text construct (Atom 1.0)
[8] [[Atom]] の [DFN@en[[[Text construct]]]] は、[[人間可読]]の[[文章]]を含みます。
普通は短い[[文章]]です。 [SRC@en[[[Atom 1.0]] 3.1.]]
:[[内容モデル]]:[CODE(XMLa)@en[[[type]]]] 依存
:[[属性]]:[CODE(XMLa)@en[[[type]]]]
[9] 仕様書:
- [CITE@en[RFC 4287 - The Atom Syndication Format]] ([TIME[2008-08-30 23:12:03 +09:00]] 版) <http://tools.ietf.org/html/rfc4287#section-3.1>
** 意味
[10] [[Text construct]] の[[内容]]は [[Language-Sensitive]] です
[SRC@en[[[Atom 1.0]] 3.1.]]。
** 内容
[22] [[Text construct]] の[[要素]]の[[内容]]は、 [CODE(XMLa)@en[[[type]]]] [[属性]]の値によって決まります。
*** テキスト
[23] [CODE(XMLa)@en[[[type]]]] が [DFN@en[[CODE(XML)@en[[[text]]]]]] の場合、
[[子要素]]を含んでは[['''なりません''']] [SRC@en[[[Atom 1.0]] 3.1.1.1.]]。
*** HTML
[27] [CODE(XMLa)@en[[[type]]]] が [DFN@en[[CODE(XML)@en[[[html]]]]]] の場合、
[[子要素]]を含んでは[['''なりません''']] [SRC@en[[[Atom 1.0]] 3.1.1.2.]]。
[28] [[内容]]は [[HTML 4.01]] として処理するのに適切である[['''べきです''']]。
[[HTML]] [[マーク付け]]は [[escape]] しなければ[['''なりません''']]。
[CODE(HTMLe)@en[[[div]]]] [[要素]]内に現れたとして[[妥当]]である[['''べきです''']]。
[SRC@en[[[Atom 1.0]] 3.1.1.2.]]
;; [[escaped markup]] の項も参照してください。
*** XHTML
[30] [CODE(XMLa)@en[[[type]]]] が [DFN@en[[CODE(XML)@en[[[xhtml]]]]]] の場合、
[[内容]]は [[XHTML m12n 1.0]] [CODE(HTMLe)@en[[[div]]]] [[要素]]だけでなければ[['''なりません''']]。
[[XHTML]] として処理するのに適切である[['''べきです''']]。
[SRC@en[[[Atom 1.0]] 3.1.1.3.]]
[31] [CODE(HTMLe)@en[[[div]]]] [[要素]]自体は内容の一部と考えては[['''なりません''']]。
[SRC@en[[[Atom 1.0]] 3.1.1.3.]]
[32] でも、 [CODE(HTMLe)@en[[[div]]]] [[要素]]自体は内容でないとしても、そこに
[CODE(HTMLa)@en[[[lang]]]] [[属性]]や [CODE(HTMLa)@en[[[dir]]]] [[属性]]が指定されることがあるので、
注意が必要です。
とはいっても、 [CODE(HTMLe)@en[[[div]]]] [[要素]]が特別なのではなく、
それ以外にも [CODE(XMLa)@en[[[xml:base]]]] [[属性]]や[[名前空間属性]]などのように[[先祖]]
([CODE(HTMLe)@en[[[div]]]] より更に上からも。) から[[継承]]する[[属性]]は色々ありますので、
[[フィード]]の一部を取り出して他のところに使うときには本当に注意しないといけません。
;; もちろん、他の [CODE(XMLa)@en[[[type]]]] でもです。
** 処理
[38] 未知の [CODE(XMLa)@en[type]] に遭遇した時どうするべきなのかは不明です。
[39] [CODE(XML)@en[[[type]]=[[text]]]] や [CODE(XMLa)@en[[[type]]=[[html]]]]
で[[子要素]]が出現した時どうするべきなのかは不明です。
[40] [CODE(XML)@en[[[type]]=[[xhtml]]]] で
[CODE(HTMLe)@en[div]] [[要素]]がなかったり、他に[[子要素]]があったりするときどうするべきなのかは不明です。
** レンダリング
*** テキスト
[24]
[CODE(XMLa)@en[[[type]]]] が [CODE(XML)@en[[[text]]]] の場合、
[[Atom処理器]]は[[空白]] ([[改行]]を含みます。) をまとめたり、
[[両端揃え]]や[[可変幅フォント]]のような[[組版]]上の技術を適用したりして[['''構いません''']]
[SRC@en[[[Atom 1.0]] 3.1.1.1.]]。
** 歴史
[18] [[Atom 0.3]] では [CODE(XMLe)@en[atom:[[content]]]] [[要素]]も含めて [[Content construct]]
という名前でしたが、 [[Atom 1.0]] では [[Text construct]] に改名され、
同[[要素]]は別個の定義となりました。
[19] [[Atom 0.3]] の [[Content construct]] には [CODE(XMLa)@en[[[mode]]]] と
[CODE(XMLa)@en[[[type]]]] の2つの[[属性]]がありましたが、両者は統合されて
[CODE(XMLa)@en[[[type]]]] [[属性]]のみになりました。
** 関連
[17] [[Atom 1.0]] の [CODE(XMLe)@en[atom:[[content]]]] [[要素]]は [[Text construct]] と似ていますが、
[[平文]]や [[HTML]] 以外の内容も表せます。
** 例
[25]
[PRE(XML example code)[
<title type="text">
Less: <
</title>
]PRE]
;; [[Atom 1.0]] 3.1.1.1.
[26]
[PRE(XML example code)[
<title type="html">
Less: <em> &lt; </em>
</title>
]PRE]
;; [[Atom 1.0]] 3.1.1.2.
[29]
[PRE(XML example code)[
<title type="xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<xhtml:div>
Less: <xhtml:em> < </xhtml:em>
</xhtml:div>
</title>
]PRE]
;; [[Atom 1.0]] 3.1.1.3.
[33]
[PRE(XML example code)[
<summary type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
This is <b>XHTML</b> content.
</div>
</summary>
]PRE]
;; [[Atom 1.0]] 3.1.1.3.
[34]
[PRE(XML example code)[
<summary type="xhtml">
<xhtml:div xmlns:xhtml="http://www.w3.org/1999/xhtml">
This is <xhtml:b>XHTML</xhtml:b> content.
</xhtml:div>
</summary>
]PRE]
;; [[Atom 1.0]] 3.1.1.3.
[35]
[PRE(XML example code)[
<summary type="xhtml">
<xh:div>
This is <xh:b>XHTML</xh:b> content.
</xh:div>
</summary>
]PRE]
;; [[Atom 1.0]] 3.1.1.3.
[7] [CITE[A Blog From Behind the Trenches]] ([TIME[2008-12-06 00:55:06 +09:00]] 版) <http://my.opera.com/haavard/xml/atom/blog/>
>
[PRE(XML example code)[
<entry>
<title type="xhtml" xml:lang="en">
<div xmlns="http://www.w3.org/1999/xhtml" lang="en" dir="ltr">Net Applications admits to skewed statistics</div>
</title>
<author>
<name>Haavard</name>
</author>
<link href="http://my.opera.com/haavard/blog/show.dml/2779029"/>
<id>http://my.opera.com/haavard/blog/2779029</id>
<updated>2008-12-03T12:56:55Z</updated>
<content xml:lang="en" type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml" lang="en" dir="ltr"><hr/>In an article at "The Industry Standard", Net Applications apparently <a href="http://www.thestandard.com/news/2008/12/02/safari-tops-7-global-browser-market-share-sort" target="_blank">admit that their numbers are skewed</a>. More specifically, they admit that they are skewed towards certain regions of the world (US-centric, anyone?). In such an amazing moment of honesty, I wonder why they didn't also admit to actively <a href="http://my.opera.com/haavard/blog/2008/09/04/why-is-net-applications-hitslink-changing-its-browser-stats-after-publishing" target="_blank">editing their own statistics</a>.<br/><br/><strong>Update:</strong> Their claim to be skewed towards Europe doesn't really match <a href="http://www.xitimonitor.com/en-us/browsers-barometer/browsers-barometer-september-2008/index-1-2-3-145.html" target="_blank">XiTi Monitor's statistics for Europe</a>. This would indicate that Net Applications is <strong>heavily</strong> skewed towards the US.</div></content>
</entry>
]PRE]
[CODE(XMLe)@en[atom:[[content]]]] [[要素]]や [[Text construct]] である [CODE(XMLa)@en[atom:[[title]]]]
[[要素]]の[[子供]]の [CODE(HTMLe)@en[[[div]]]] [[要素]]に[[属性]]が指定されています。
意外と珍しい気がします。 [CODE(XML)@en[[[type]]=[[xhtml]]]] 自体珍しいかもしれませんが、
その中でも更に珍しいんじゃないかな。 [CODE(XMLa)@en[[[xml:lang]]]] [[属性]]でなく
[CODE(HTMLa)@en[[[lang]]]] [[属性]]を使っているところにも注目したいですね。
* Content construct (Atom 0.3)
[1] [[Atom 0.3]] の [DFN[[[Content construct]]]] は、
任意の[[子供]][[内容]]を含めることができます [SRC@en[[[Atom 0.3]]]]。
仕様書:
[CITE[The Atom Syndication Format 0.3 (PRE-DRAFT)]] ([TIME[2006-12-22 17:03:44 +09:00]] 版) <http://www.mnot.net/drafts/draft-nottingham-atom-format-02.html#rfc.section.3.1>
[2] [[属性]]は2つあり、[[子供]]の[[特性]]を指定します [SRC@en[[[Atom 0.3]]]]。
- [CODE(XMLa)@en[[[type]]]]
- [CODE(XMLa)@en[[[mode]]]]
** 関連
[6] [[Content construct]] は、 [[Atom 1.0]] では [[Text construct]] に改名され、
2つの[[属性]]も1つの [CODE(XMLa)@en[[[type]]]] [[属性]]に統合されています。
更に、 [CODE(XMLe)@en[atom:[[content]]]] [[要素]]は独立した[[内容モデル]]に変更されています。
* [CODE(XMLa)@en[type]] 属性 (Atom 1.0)
[11] [[Atom 1.0]] の [[Text construct]] の
[DFN[[CODE(XMLa)@en[[[type]]]] [[属性]]]]は、
[[内容]]の種類を表します。
[12]
:[[要素]]: [[Text construct]] の[[要素]]
:[[属性名]]:[CODE(XMLa)@en[[[type]]]]
:[[データ型]]:[CODE(XML)@en[[[text]]]] | [CODE(XML)@en[[[html]]]] | [CODE(XML)@en[[[xhtml]]]]
:[[既定値]]:[CODE(XML)@en[[[text]]]]
[13] 仕様書:
-[CITE@en[RFC 4287 - The Atom Syndication Format]] ([TIME[2008-08-30 23:12:03 +09:00]] 版) <http://tools.ietf.org/html/rfc4287#section-3.1.1>
** 属性値
[14] [[Atom 1.0]] では3種類の値が定義されています。
:[CODE(XML)@en[[[text]]]]:[[平文]]を表します。
:[CODE(HTML)@en[[[html]]]]:[[HTML]] を表します。 [[escaped markup]] として解釈されます。
:[CODE(HTML)@en[[[xhtml]]]]:[[XHTML]] を表します。[[子孫要素]]がそのまま [[HTML]] 片として解釈されます。
[21] [CODE(XMLe)@en[atom:[[content]]]] [[属性]]の [CODE(XMLa)@en[[[type]]]] [[属性]]とは異なり、
[[媒体型]]を指定しては[['''なりません''']] [SRC@en[[[Atom 1.0]] 3.1.1.]]。
** 既定値
[15] この[[属性]]の[[既定値]]は陽には定義されていません。
[16] [[Atom処理器]]は、この[[属性]]が存在しない場合、
[CODE(XML)@en[[[text]]]] と同じように動作しなければ[['''なりません''']]
[SRC@en[[[Atom 1.0]] 3.1.1.]]。
** 歴史
[20] [[Atom 0.3]] [[Content construct]] には [CODE(XMLa)@en[[[type]]]] [[属性]]と
[CODE(XMLa)@en[[[mode]]]] [[属性]]がありましたが、 [[Atom 1.0]]
では両者が統合され、 [CODE(XMLa)@en[[[type]]]] [[属性]]のみとなりました。
[[Content construct]] と違って [[Base64]] や任意の[[媒体型]]を使うことはできなくなっています
([[Atom 1.0]] [CODE(XMLe)@en[atom:[[content]]]] [[要素]]では可能です)。
* [CODE(XMLa)@en[mode]] 属性 (Atom 0.3)
[3] [[Atom 0.3]] の [[Content construct]] の
[DFN[[CODE(XMLa)@en[mode]] [[属性]]]]は、
[[内容]]の[[符号化]]の方法を表します [SRC@en[[[Atom 0.3]]]]。
:状態:[[廃止]] → [[Atom 1.0]] [[Text construct]]/[CODE(XMLe)@en[atom:[[content]]]] [CODE(XMLa)@en[[[type]]]]
:[[要素]]:[[Content construct]] な[[要素]]
:[[局所名]]:[CODE(XMLa)@en[[[mode]]]]
:[[データ型]]:[CODE(XML)@en[[[xml]]]] / [CODE(XML)@en[[[escaped]]]] / [CODE(XML)@en[[[base64]]]]
仕様書:
[CITE[The Atom Syndication Format 0.3 (PRE-DRAFT)]] ([TIME[2006-12-22 17:03:44 +09:00]] 版) <http://www.mnot.net/drafts/draft-nottingham-atom-format-02.html#rfc.section.3.1.2>
** 属性値
[4] [[属性値]]は次のいずれかでなければ[['''なりません''']] [SRC@en[[[Atom 0.3]]]]。
:[DFN[[CODE(XML)@en[[[xml]]]]]]:
[[要素]]の[[内容]]が[[行内]] [[XML]] であることを表します。
(例: [[名前空間]]に属する [[XHTML]]) [SRC@en[[[Atom 0.3]]]]
:[DFN[[CODE(XML)@en[[[escaped]]]]]]:
[[要素]]の[[内容]]が[[逃避]]された[[文字列]]であることを示します。
[[処理器]]は、 [CODE(XMLa)@en[[[type]]]] で指定された[[媒体型]]として解釈する前に[[逃避]]を元に戻さなければ[['''なりません''']]。 [SRC@en[[[Atom 0.3]]]]
:[DFN[[CODE(XML)@en[[[base64]]]]]]:
[[要素]]の[[内容]]は [[RFC 2045]] [[Base64]] で[[符号化]]された[[文字列]]です。
[[処理器]]は、 [CODE(XMLa)@en[[[type]]]] で指定された[[媒体型]]として解釈する前に[[復号]]しなければ[['''なりません''']]。 [SRC@en[[[Atom 0.3]]]]
** 既定値
[5] [[既定値]]は [CODE(XML)@en[[[xml]]]] です [SRC@en[[[Atom 0.3]]]]。
* Text construct (Metalink)
[37] [[Metalink]] の [[Text construct]] は[[属性]]を持たず、常に [CODE(XML)@en[text]]
相当のようです。
[REFS[
- [36] [CITE@en[RFC 5854 - The Metalink Download Description Format]] ([TIME[2014-09-14 16:54:14 +09:00]] 版) <http://tools.ietf.org/html/rfc5854#section-3.1>
]REFS]
[FIG(quote)[
[FIGCAPTION[
[41] ([TIME[2016-03-19 18:26:28 +09:00]] 版)
<http://blog.suzaka.jp/xmlsrv/atom.php?blog=79>
]FIGCAPTION]
> <entry>
> <title type="text/plain" mode="xml">新刊入荷しました&休館日のお知らせ</title>
]FIG]
[FIG(quote)[
[FIGCAPTION[
[42] [CITE[はてなフォトライフAtomAPI - Hatena Developer Center]]
([TIME[2016-03-21 10:42:59 +09:00]] 版)
<http://developer.hatena.ne.jp/ja/documents/fotolife/apis/atom>
]FIGCAPTION]
> POST /atom/post
> <entry xmlns="http://purl.org/atom/ns#">
> <title>Sample</title>
> <content mode="base64" type="image/jpeg">/9j/2wCEAAQDAwQDAw.../9n/AA==</content>
> </entry>
]FIG]
[FIG(quote)[
[FIGCAPTION[
[43] [CITE@en[Blogger: Atom API Documentation]]
([TIME[2016-03-21 11:04:04 +09:00]] 版)
<https://blogger-developers.googleblog.com/archives/atom-docs.html>
]FIGCAPTION]
>
> <title mode="escaped" type="text/plain">atom test</title>
]FIG]
[FIG(quote)[
[FIGCAPTION[
[44] [CITE@en[Blogger: Atom API Documentation]]
([TIME[2016-03-21 11:04:25 +09:00]] 版)
<https://blogger-developers.googleblog.com/archives/atom-docs.html>
]FIGCAPTION]
>
> <content type="application/xhtml+xml">
> <div xmlns="http://www.w3.org/1999/xhtml">Testing the Atom API</div>
> </content>
]FIG]