1 |
wakaba |
1.1 |
Module: |
2 |
|
|
@QName: Markup|Atom |
3 |
|
|
@enFN: |
4 |
|
|
Atom DOM |
5 |
|
|
@enDesc: |
6 |
|
|
The <DFN::Atom DOM> is a language and platform independent |
7 |
|
|
programming language interface to Atom 1.0 documents |
8 |
|
|
built on the W3C Document Object Model (DOM). It defines |
9 |
|
|
a number of interfaces that provide convenience |
10 |
|
|
methods and attributes to process Atom 1.0 documents. |
11 |
|
|
|
12 |
|
|
{TODO:: |
13 |
|
|
- Move descriptions below to somewhere. |
14 |
|
|
|
15 |
|
|
- Formal definition for <IF::StaticNodeList> (reference |
16 |
|
|
to Selectors API?) is necessary. |
17 |
|
|
} |
18 |
|
|
|
19 |
|
|
Some attributes are defined to contain a <IF::StaticNodeList>. |
20 |
|
|
Multiple invocations for such an attribute don't have |
21 |
|
|
to return exactly same object, even if no changes are made |
22 |
|
|
on the underlying DOM structure. |
23 |
|
|
|
24 |
|
|
{NOTE:: |
25 |
|
|
The equality of <IF::StaticNodeList> objects as per |
26 |
|
|
the <M::Node.isEqualNode> method, however, is |
27 |
|
|
preserved as long as the underlying DOM structure |
28 |
|
|
and the configuration parameters are not changed. |
29 |
|
|
} |
30 |
|
|
|
31 |
|
|
Methods and attributes defined in this module does <EM::not> |
32 |
|
|
support <IF::tx|EntityReference>s; for example, an element |
33 |
|
|
node that is a child node of an entity reference node |
34 |
|
|
that is a child node of another element node is <EM::not> considered |
35 |
|
|
as a child element node of the other element node. As a |
36 |
|
|
result, applications written using this module might ignore |
37 |
|
|
parts of Atom documents unless they configures their XML |
38 |
|
|
parser not to expose entity references in the result DOM tree. |
39 |
|
|
|
40 |
|
|
@Namespace: |
41 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Markup/Atom/ |
42 |
|
|
|
43 |
|
|
@DISCore:author: DISCore|Wakaba |
44 |
|
|
@License: license|Perl+MPL |
45 |
|
|
@Date: |
46 |
wakaba |
1.21 |
$Date: 2006/12/29 14:45:44 $ |
47 |
wakaba |
1.1 |
|
48 |
|
|
@Require: |
49 |
|
|
@@Module: |
50 |
|
|
@@@QName: Markup|common |
51 |
|
|
@@Module: |
52 |
|
|
@@@QName: MDOM|TreeCore |
53 |
|
|
@@@WithFor: ManakaiDOM|ManakaiDOMLatest |
54 |
|
|
@@Module: |
55 |
wakaba |
1.11 |
@@@QName: DISlib|DISMarkup |
56 |
|
|
@@@WithFor: ManakaiDOM|all |
57 |
wakaba |
1.1 |
@DefaultFor: ManakaiDOM|ManakaiDOMLatest |
58 |
|
|
|
59 |
|
|
Namespace: |
60 |
|
|
@atom: |
61 |
|
|
http://www.w3.org/2005/Atom |
62 |
|
|
@c: |
63 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core# |
64 |
|
|
@cfg: |
65 |
|
|
http://suika.fam.cx/www/2006/dom-config/ |
66 |
wakaba |
1.11 |
@DISlib: |
67 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dis/ |
68 |
wakaba |
1.1 |
@dis: |
69 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis-- |
70 |
wakaba |
1.4 |
@dlp: |
71 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dis/Perl# |
72 |
wakaba |
1.1 |
@d: |
73 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dom/xdt# |
74 |
|
|
@DOMMain: |
75 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dom/main# |
76 |
wakaba |
1.15 |
@domperl: |
77 |
|
|
http://suika.fam.cx/~wakaba/archive/2006/dom/perl/ |
78 |
wakaba |
1.1 |
@dx: |
79 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException# |
80 |
wakaba |
1.9 |
@dxm: |
81 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dis/XML# |
82 |
wakaba |
1.1 |
@ecore: |
83 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/Core/ |
84 |
|
|
@f: |
85 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dom/feature# |
86 |
|
|
@fe: |
87 |
|
|
http://suika.fam.cx/www/2006/feature/ |
88 |
|
|
@html: |
89 |
|
|
http://www.w3.org/1999/xhtml |
90 |
|
|
@idl: |
91 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dis/IDL# |
92 |
|
|
@kwd: |
93 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/rfc2119/ |
94 |
|
|
@lang: |
95 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/18/lang# |
96 |
|
|
@license: |
97 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/18/license# |
98 |
|
|
@ManakaiDOM: |
99 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom# |
100 |
|
|
@Markup: |
101 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/Markup# |
102 |
|
|
@MDOM: |
103 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM. |
104 |
|
|
@MDOMX: |
105 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception# |
106 |
wakaba |
1.4 |
@mv: |
107 |
|
|
http://suika.fam.cx/www/2006/05/mv/ |
108 |
wakaba |
1.1 |
@rel: |
109 |
|
|
http://www.iana.org/assignments/relation/ |
110 |
|
|
@s: |
111 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dis/Markup# |
112 |
|
|
@tc: |
113 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/ |
114 |
|
|
@td: |
115 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Document/ |
116 |
|
|
@te: |
117 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Element/ |
118 |
|
|
@test: |
119 |
|
|
http://suika.fam.cx/~wakaba/archive/2004/dis/Test# |
120 |
wakaba |
1.14 |
@thr: |
121 |
|
|
http://purl.org/syndication/thread/1.0 |
122 |
wakaba |
1.1 |
@tx: |
123 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/XML/ |
124 |
|
|
@urigen: |
125 |
|
|
http://suika.fam.cx/~wakaba/archive/2005/manakai/URI/Generic/ |
126 |
|
|
@xml: |
127 |
|
|
http://www.w3.org/XML/1998/namespace |
128 |
|
|
|
129 |
|
|
ElementTypeBinding: |
130 |
|
|
@Name: CODE |
131 |
|
|
@ElementType: |
132 |
|
|
dis:ResourceDef |
133 |
|
|
@ShadowContent: |
134 |
|
|
@@DISCore:resourceType: dlp|BlockCode |
135 |
|
|
@@ForCheck: ManakaiDOM|ForClass |
136 |
|
|
|
137 |
|
|
ElementTypeBinding: |
138 |
|
|
@Name: Method |
139 |
|
|
@ElementType: |
140 |
|
|
dis:ResourceDef |
141 |
|
|
@ShadowContent: |
142 |
|
|
@@DISCore:resourceType: DISLang|Method |
143 |
|
|
@@ForCheck: !=ManakaiDOM|ManakaiDOM |
144 |
|
|
|
145 |
|
|
ElementTypeBinding: |
146 |
|
|
@Name: Param |
147 |
|
|
@ElementType: |
148 |
|
|
dis:ResourceDef |
149 |
|
|
@ShadowContent: |
150 |
|
|
@@DISCore:resourceType: DISLang|MethodParameter |
151 |
|
|
|
152 |
|
|
ElementTypeBinding: |
153 |
|
|
@Name: Return |
154 |
|
|
@ElementType: |
155 |
|
|
dis:ResourceDef |
156 |
|
|
@ShadowContent: |
157 |
|
|
@@DISCore:resourceType: DISLang|MethodReturn |
158 |
|
|
|
159 |
|
|
ElementTypeBinding: |
160 |
|
|
@Name: Attr |
161 |
|
|
@ElementType: |
162 |
|
|
dis:ResourceDef |
163 |
|
|
@ShadowContent: |
164 |
|
|
@@DISCore:resourceType: DISLang|Attribute |
165 |
|
|
@@ForCheck: !=ManakaiDOM|ManakaiDOM |
166 |
|
|
|
167 |
|
|
ElementTypeBinding: |
168 |
wakaba |
1.6 |
@Name: ATTR |
169 |
|
|
@ElementType: |
170 |
|
|
dis:ResourceDef |
171 |
|
|
@ShadowContent: |
172 |
|
|
@@DISCore:resourceType: |
173 |
|
|
@@@@: DISLang|Attribute |
174 |
|
|
@@@ForCheck: ManakaiDOM|ForIF |
175 |
|
|
@@DISCore:resourceType: |
176 |
|
|
@@@@: DISLang|Attribute |
177 |
|
|
@@@ForCheck: ManakaiDOM|ForClass |
178 |
|
|
@@DISCore:resourceType: |
179 |
wakaba |
1.7 |
@@@@: mv|AttributeType |
180 |
wakaba |
1.6 |
@@@ForCheck: s|ForML |
181 |
|
|
@@ForCheck: !=ManakaiDOM|ManakaiDOM |
182 |
|
|
|
183 |
|
|
ElementTypeBinding: |
184 |
wakaba |
1.1 |
@Name: Get |
185 |
|
|
@ElementType: |
186 |
|
|
dis:ResourceDef |
187 |
|
|
@ShadowContent: |
188 |
|
|
@@DISCore:resourceType: DISLang|AttributeGet |
189 |
|
|
|
190 |
|
|
ElementTypeBinding: |
191 |
|
|
@Name: Set |
192 |
|
|
@ElementType: |
193 |
|
|
dis:ResourceDef |
194 |
|
|
@ShadowContent: |
195 |
|
|
@@DISCore:resourceType: DISLang|AttributeSet |
196 |
|
|
|
197 |
|
|
ElementTypeBinding: |
198 |
|
|
@Name: nullCase |
199 |
|
|
@ElementType: |
200 |
|
|
dis:ResourceDef |
201 |
|
|
@ShadowContent: |
202 |
|
|
@@DISCore:resourceType: ManakaiDOM|InCase |
203 |
|
|
@@Value: |
204 |
|
|
@@@is-null:1 |
205 |
|
|
|
206 |
|
|
ElementTypeBinding: |
207 |
|
|
@Name: PerlDef |
208 |
|
|
@ElementType: |
209 |
|
|
dis:Def |
210 |
|
|
@ShadowContent: |
211 |
|
|
@@ContentType: lang|Perl |
212 |
|
|
@@ForCheck: ManakaiDOM|ForClass |
213 |
|
|
|
214 |
|
|
ElementTypeBinding: |
215 |
|
|
@Name: PerlCDef |
216 |
|
|
@ElementType: |
217 |
|
|
dis:Def |
218 |
|
|
@ShadowContent: |
219 |
|
|
@@ContentType: lang|Perl |
220 |
|
|
|
221 |
|
|
ElementTypeBinding: |
222 |
|
|
@Name: enImplNote |
223 |
|
|
@ElementType: |
224 |
|
|
dis:ImplNote |
225 |
|
|
@ShadowContent: |
226 |
|
|
@@lang:en |
227 |
|
|
|
228 |
|
|
ElementTypeBinding: |
229 |
|
|
@Name: enFN |
230 |
|
|
@ElementType: |
231 |
|
|
dis:FullName |
232 |
|
|
@ShadowContent: |
233 |
|
|
@@lang:en |
234 |
|
|
|
235 |
|
|
ElementTypeBinding: |
236 |
|
|
@Name: IFClsETDef |
237 |
|
|
@ElementType: |
238 |
|
|
dis:ResourceDef |
239 |
|
|
@ShadowContent: |
240 |
|
|
@@DISCore:resourceType: |
241 |
|
|
@@@@: dis|MultipleResource |
242 |
|
|
@@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass !s|ForML |
243 |
|
|
@@resourceFor: ManakaiDOM|ForIF |
244 |
|
|
@@resourceFor: ManakaiDOM|ForClass |
245 |
|
|
@@resourceFor: s|ForML |
246 |
|
|
@@For: ManakaiDOM|ManakaiDOM |
247 |
|
|
|
248 |
|
|
@@DISCore:resourceType: |
249 |
|
|
@@@@: DISLang|Interface |
250 |
|
|
@@@ForCheck: ManakaiDOM|ForIF |
251 |
|
|
|
252 |
|
|
@@DISCore:resourceType: |
253 |
|
|
@@@@: DISLang|Class |
254 |
|
|
@@@ForCheck: ManakaiDOM|ForClass |
255 |
wakaba |
1.21 |
|
256 |
wakaba |
1.1 |
@@Implement: |
257 |
|
|
@@@@: ||ManakaiDOM|ManakaiDOMLatest||ManakaiDOM|ForIF |
258 |
|
|
@@@ContentType: DISCore|TFPQNames |
259 |
|
|
@@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOMLatest |
260 |
|
|
|
261 |
|
|
@@s:elementType: |
262 |
|
|
@@@@: ||+||s|ForML |
263 |
|
|
@@@ContentType: DISCore|TFPQNames |
264 |
|
|
@@@DISCore:stopISARecursive:1 |
265 |
|
|
|
266 |
|
|
@@DISCore:resourceType: |
267 |
|
|
@@@@: s|ElementType |
268 |
|
|
@@@ForCheck: s|ForML |
269 |
|
|
|
270 |
|
|
ElementTypeBinding: |
271 |
|
|
@Name: IFClsDef |
272 |
|
|
@ElementType: |
273 |
|
|
dis:ResourceDef |
274 |
|
|
@ShadowContent: |
275 |
|
|
@@DISCore:resourceType: |
276 |
|
|
@@@@: dis|MultipleResource |
277 |
|
|
@@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass !s|ForML |
278 |
|
|
@@resourceFor: ManakaiDOM|ForIF |
279 |
|
|
@@resourceFor: ManakaiDOM|ForClass |
280 |
|
|
@@For: ManakaiDOM|ManakaiDOM |
281 |
|
|
|
282 |
|
|
@@DISCore:resourceType: |
283 |
|
|
@@@@: DISLang|Interface |
284 |
|
|
@@@ForCheck: ManakaiDOM|ForIF |
285 |
|
|
|
286 |
|
|
@@DISCore:resourceType: |
287 |
|
|
@@@@: DISLang|Class |
288 |
|
|
@@@ForCheck: ManakaiDOM|ForClass |
289 |
wakaba |
1.21 |
|
290 |
wakaba |
1.1 |
@@Implement: |
291 |
|
|
@@@@: ||ManakaiDOM|ManakaiDOMLatest||ManakaiDOM|ForIF |
292 |
|
|
@@@ContentType: DISCore|TFPQNames |
293 |
|
|
@@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOMLatest |
294 |
|
|
|
295 |
|
|
ElementTypeBinding: |
296 |
wakaba |
1.6 |
@Name: IFClsConstructDef |
297 |
|
|
@ElementType: |
298 |
|
|
dis:ResourceDef |
299 |
|
|
@ShadowContent: |
300 |
|
|
@@DISCore:resourceType: |
301 |
|
|
@@@@: dis|MultipleResource |
302 |
wakaba |
1.7 |
@@@ForCheck: |
303 |
|
|
!ManakaiDOM|ForIF !ManakaiDOM|ForClass !s|ForML !mv|ForCM !mv|ForAG |
304 |
wakaba |
1.6 |
@@resourceFor: ManakaiDOM|ForIF |
305 |
|
|
@@resourceFor: ManakaiDOM|ForClass |
306 |
|
|
@@resourceFor: mv|ForCM |
307 |
|
|
@@resourceFor: mv|ForAG |
308 |
|
|
@@For: ManakaiDOM|ManakaiDOM |
309 |
|
|
|
310 |
|
|
@@DISCore:resourceType: |
311 |
|
|
@@@@: DISLang|Interface |
312 |
|
|
@@@ForCheck: ManakaiDOM|ForIF |
313 |
|
|
|
314 |
|
|
@@DISCore:resourceType: |
315 |
|
|
@@@@: DISLang|Class |
316 |
|
|
@@@ForCheck: ManakaiDOM|ForClass |
317 |
wakaba |
1.21 |
|
318 |
wakaba |
1.6 |
@@Implement: |
319 |
|
|
@@@@: ||ManakaiDOM|ManakaiDOMLatest||ManakaiDOM|ForIF |
320 |
|
|
@@@ContentType: DISCore|TFPQNames |
321 |
|
|
@@@ForCheck: ManakaiDOM|ForClass ManakaiDOM|ManakaiDOMLatest |
322 |
|
|
|
323 |
|
|
@@DISCore:resourceType: |
324 |
|
|
@@@@: mv|AttributeTypeGroup |
325 |
|
|
@@@ForCheck: mv|ForAG |
326 |
|
|
|
327 |
|
|
@@DISCore:resourceType: |
328 |
|
|
@@@@: mv|ElementContentModel |
329 |
|
|
@@@ForCheck: mv|ForCM |
330 |
|
|
|
331 |
|
|
|
332 |
|
|
ElementTypeBinding: |
333 |
wakaba |
1.1 |
@Name: IFQName |
334 |
|
|
@ElementType: |
335 |
|
|
dis:QName |
336 |
|
|
@ShadowContent: |
337 |
|
|
@@ForCheck: ManakaiDOM|ForIF |
338 |
|
|
|
339 |
|
|
ElementTypeBinding: |
340 |
|
|
@Name: ClsQName |
341 |
|
|
@ElementType: |
342 |
|
|
dis:QName |
343 |
|
|
@ShadowContent: |
344 |
|
|
@@ForCheck: ManakaiDOM|ForClass |
345 |
|
|
|
346 |
|
|
ElementTypeBinding: |
347 |
|
|
@Name: ETRQName |
348 |
|
|
@ElementType: |
349 |
|
|
dis:QName |
350 |
|
|
@ShadowContent: |
351 |
|
|
@@ForCheck: s|ForML |
352 |
|
|
|
353 |
|
|
ElementTypeBinding: |
354 |
|
|
@Name: ETQName |
355 |
|
|
@ElementType: |
356 |
|
|
dis:AppName |
357 |
|
|
@ShadowContent: |
358 |
|
|
@@ForCheck: s|ForML |
359 |
|
|
@@ContentType: DISCore|QName |
360 |
|
|
|
361 |
|
|
ElementTypeBinding: |
362 |
wakaba |
1.6 |
@Name: CMQName |
363 |
|
|
@ElementType: |
364 |
|
|
dis:QName |
365 |
|
|
@ShadowContent: |
366 |
|
|
@@ForCheck: mv|ForCM |
367 |
|
|
|
368 |
|
|
ElementTypeBinding: |
369 |
|
|
@Name: CMName |
370 |
|
|
@ElementType: |
371 |
|
|
mv:elementContentModelName |
372 |
|
|
@ShadowContent: |
373 |
|
|
@@ForCheck: mv|ForCM |
374 |
|
|
|
375 |
|
|
ElementTypeBinding: |
376 |
|
|
@Name: AGQName |
377 |
|
|
@ElementType: |
378 |
|
|
dis:QName |
379 |
|
|
@ShadowContent: |
380 |
|
|
@@ForCheck: mv|ForAG |
381 |
|
|
|
382 |
|
|
ElementTypeBinding: |
383 |
|
|
@Name: AGName |
384 |
|
|
@ElementType: |
385 |
|
|
mv:attributeTypeGroupName |
386 |
|
|
@ShadowContent: |
387 |
|
|
@@ForCheck: mv|ForAG |
388 |
|
|
|
389 |
|
|
ElementTypeBinding: |
390 |
wakaba |
1.1 |
@Name: IFISA |
391 |
|
|
@ElementType: |
392 |
|
|
dis:ISA |
393 |
|
|
@ShadowContent: |
394 |
|
|
@@ForCheck: ManakaiDOM|ForIF |
395 |
|
|
|
396 |
|
|
ElementTypeBinding: |
397 |
|
|
@Name: ClsISA |
398 |
|
|
@ElementType: |
399 |
|
|
dis:ISA |
400 |
|
|
@ShadowContent: |
401 |
|
|
@@ForCheck: ManakaiDOM|ForClass |
402 |
|
|
|
403 |
|
|
ElementTypeBinding: |
404 |
|
|
@Name: disDef |
405 |
|
|
@ElementType: |
406 |
|
|
dis:Def |
407 |
|
|
@ShadowContent: |
408 |
|
|
@@ContentType: |
409 |
|
|
lang:dis |
410 |
|
|
@@ForCheck: ManakaiDOM|ForClass |
411 |
|
|
|
412 |
|
|
ElementTypeBinding: |
413 |
|
|
@Name: Code |
414 |
|
|
@ElementType: |
415 |
|
|
dis:ResourceDef |
416 |
|
|
@ShadowContent: |
417 |
|
|
@@DISCore:resourceType: dlp|InlineCode |
418 |
|
|
@@ForCheck: ManakaiDOM|ForClass |
419 |
|
|
|
420 |
|
|
ElementTypeBinding: |
421 |
|
|
@Name: Test |
422 |
|
|
@ElementType: |
423 |
|
|
dis:ResourceDef |
424 |
|
|
@ShadowContent: |
425 |
|
|
@@DISCore:resourceType: test|StandaloneTest |
426 |
|
|
@@ForCheck: ManakaiDOM|ForClass |
427 |
|
|
|
428 |
|
|
ElementTypeBinding: |
429 |
|
|
@Name: TestC |
430 |
|
|
@ElementType: |
431 |
|
|
dis:ResourceDef |
432 |
|
|
@ShadowContent: |
433 |
|
|
@@DISCore:resourceType: test|StandaloneTest |
434 |
|
|
|
435 |
|
|
ResourceDef: |
436 |
|
|
@QName: Document |
437 |
|
|
@AliasFor: td|Document |
438 |
|
|
@For: ManakaiDOM|DOM |
439 |
|
|
|
440 |
|
|
ResourceDef: |
441 |
|
|
@QName: Element |
442 |
|
|
@AliasFor: te|Element |
443 |
|
|
@For: ManakaiDOM|DOM |
444 |
|
|
|
445 |
|
|
ResourceDef: |
446 |
|
|
@QName: Attr |
447 |
|
|
@AliasFor: te|Attr |
448 |
|
|
@For: ManakaiDOM|DOM |
449 |
|
|
|
450 |
|
|
ResourceDef: |
451 |
|
|
@QName: DOMString |
452 |
|
|
@AliasFor: DOMMain|DOMString |
453 |
|
|
@For: ManakaiDOM|DOM |
454 |
|
|
|
455 |
|
|
ResourceDef: |
456 |
|
|
@QName: DOMURI |
457 |
|
|
@AliasFor: ManakaiDOM|ManakaiDOMURI |
458 |
|
|
@For: ManakaiDOM|DOM3 |
459 |
|
|
|
460 |
|
|
ResourceDef: |
461 |
|
|
@QName: DOMTimeStamp |
462 |
|
|
@AliasFor: DOMMain|DOMTimeStamp |
463 |
|
|
@For: ManakaiDOM|DOM2 |
464 |
|
|
|
465 |
|
|
ResourceDef: |
466 |
|
|
@QName: boolean |
467 |
|
|
@AliasFor: idl|boolean||ManakaiDOM|all |
468 |
|
|
|
469 |
|
|
ResourceDef: |
470 |
|
|
@QName: Node |
471 |
|
|
@AliasFor: tc|Node |
472 |
|
|
@For: ManakaiDOM|ManakaiDOM |
473 |
|
|
|
474 |
|
|
ResourceDef: |
475 |
|
|
@QName: NodeList |
476 |
|
|
@AliasFor: tc|NodeList |
477 |
|
|
@For: ManakaiDOM|ManakaiDOM |
478 |
|
|
|
479 |
|
|
ResourceDef: |
480 |
|
|
@QName: StaticNodeList |
481 |
|
|
@AliasFor: tc|StaticNodeList |
482 |
|
|
@For: ManakaiDOM|ManakaiDOM |
483 |
|
|
|
484 |
|
|
ElementTypeBinding: |
485 |
|
|
@Name: enDesc |
486 |
|
|
@ElementType: |
487 |
|
|
dis:Description |
488 |
|
|
@ShadowContent: |
489 |
|
|
@@lang:en |
490 |
|
|
|
491 |
|
|
ElementTypeBinding: |
492 |
wakaba |
1.4 |
@Name: enLN |
493 |
|
|
@ElementType: |
494 |
|
|
mv:longName |
495 |
|
|
@ShadowContent: |
496 |
|
|
@@lang:en |
497 |
|
|
|
498 |
|
|
ElementTypeBinding: |
499 |
wakaba |
1.1 |
@Name: TrueCase |
500 |
|
|
@ElementType: |
501 |
|
|
dis:ResourceDef |
502 |
|
|
@ShadowContent: |
503 |
|
|
@@DISCore:resourceType: |
504 |
|
|
ManakaiDOM:InCase |
505 |
|
|
@@Value: |
506 |
|
|
@@@@: 1 |
507 |
|
|
@@@ContentType: DISCore|Boolean |
508 |
|
|
@@Type: idl|boolean||ManakaiDOM|all |
509 |
|
|
|
510 |
|
|
ElementTypeBinding: |
511 |
|
|
@Name: FalseCase |
512 |
|
|
@ElementType: |
513 |
|
|
dis:ResourceDef |
514 |
|
|
@ShadowContent: |
515 |
|
|
@@DISCore:resourceType: |
516 |
|
|
ManakaiDOM:InCase |
517 |
|
|
@@Value: |
518 |
|
|
@@@@: 0 |
519 |
|
|
@@@ContentType: DISCore|Boolean |
520 |
|
|
@@Type: idl|boolean||ManakaiDOM|all |
521 |
|
|
|
522 |
|
|
## -- Features |
523 |
|
|
|
524 |
|
|
ElementTypeBinding: |
525 |
|
|
@Name: FeatureDef |
526 |
|
|
@ElementType: |
527 |
|
|
dis:ResourceDef |
528 |
|
|
@ShadowContent: |
529 |
|
|
@@DISCore:resourceType: f|Feature |
530 |
|
|
@@For: =ManakaiDOM|all |
531 |
|
|
|
532 |
|
|
ElementTypeBinding: |
533 |
|
|
@Name: FeatureVerDef |
534 |
|
|
@ElementType: |
535 |
|
|
dis:ResourceDef |
536 |
|
|
@ShadowContent: |
537 |
|
|
@@DISCore:resourceType: f|Feature |
538 |
|
|
|
539 |
|
|
ElementTypeBinding: |
540 |
|
|
@Name: featureQName |
541 |
|
|
@ElementType: |
542 |
|
|
f:name |
543 |
|
|
@ShadowContent: |
544 |
|
|
@@ContentType: DISCore|QName |
545 |
|
|
|
546 |
|
|
FeatureDef: |
547 |
|
|
@featureQName: fe|Atom |
548 |
|
|
@QName: AtomFeature |
549 |
|
|
@FeatureVerDef: |
550 |
|
|
@@QName: AtomFeature10 |
551 |
|
|
@@Version: 1.0 |
552 |
|
|
@@f:instanceOf: AtomFeature |
553 |
|
|
@@f:requires: tx|XMLFeature30 |
554 |
|
|
@@enDesc: |
555 |
|
|
The Atom DOM, version 1.0. |
556 |
wakaba |
1.4 |
|
557 |
wakaba |
1.14 |
FeatureDef: |
558 |
|
|
@featureQName: fe|AtomThreading |
559 |
|
|
@QName: AtomThreadingFeature |
560 |
|
|
@FeatureVerDef: |
561 |
|
|
@@QName: AtomThreadingFeature10 |
562 |
|
|
@@Version: 1.0 |
563 |
|
|
@@f:instanceOf: AtomThreadingFeature |
564 |
|
|
@@f:requires: fe|AtomFeature10 |
565 |
|
|
@@enDesc: |
566 |
|
|
The Atom Threading Extension DOM, version 1.0. |
567 |
|
|
|
568 |
wakaba |
1.4 |
## -- Modules |
569 |
|
|
|
570 |
|
|
ModuleSetDef: |
571 |
|
|
@QName: Atom |
572 |
|
|
@enLN: Atom |
573 |
|
|
@mv:version: 1.0 |
574 |
wakaba |
1.7 |
@mv:contains: AtomDatatypes |
575 |
|
|
@mv:contains: AtomProperties |
576 |
|
|
@mv:contains: AtomEntry |
577 |
wakaba |
1.4 |
@mv:contains: AtomFeed |
578 |
wakaba |
1.10 |
@mv:contains: AtomQName |
579 |
|
|
|
580 |
wakaba |
1.11 |
@mv:targetNamespace: atom| |
581 |
|
|
@mv:defaultNamespacePrefix: atom |
582 |
wakaba |
1.13 |
@mv:systemIdentifierBaseURI: \ |
583 |
wakaba |
1.4 |
|
584 |
|
|
ModuleDef: |
585 |
|
|
@QName: AtomFeed |
586 |
|
|
@mv:id: feed |
587 |
|
|
@enLN: Feed |
588 |
wakaba |
1.8 |
@mv:contains: feed-prop |
589 |
wakaba |
1.4 |
@mv:contains: atom|feed |
590 |
|
|
|
591 |
|
|
ModuleDef: |
592 |
|
|
@QName: AtomEntry |
593 |
|
|
@mv:id: entry |
594 |
|
|
@enLN: Entry |
595 |
wakaba |
1.8 |
@mv:contains: entry-prop |
596 |
wakaba |
1.4 |
@mv:contains: atom|entry |
597 |
|
|
|
598 |
|
|
ModuleDef: |
599 |
wakaba |
1.6 |
@QName: AtomProperties |
600 |
|
|
@mv:id: props |
601 |
|
|
@enLN: Properties |
602 |
wakaba |
1.4 |
@mv:contains: atom|content |
603 |
wakaba |
1.8 |
@mv:contains: atom|contributor |
604 |
wakaba |
1.4 |
@mv:contains: atom|category |
605 |
|
|
@mv:contains: atom|generator |
606 |
|
|
@mv:contains: atom|link |
607 |
|
|
@mv:contains: atom|author |
608 |
|
|
@mv:contains: atom|published |
609 |
|
|
@mv:contains: atom|updated |
610 |
wakaba |
1.8 |
@mv:contains: atom|icon |
611 |
wakaba |
1.4 |
@mv:contains: atom|id |
612 |
wakaba |
1.8 |
@mv:contains: atom|logo |
613 |
|
|
@mv:contains: atom|rights |
614 |
|
|
@mv:contains: atom|subtitle |
615 |
|
|
@mv:contains: atom|summary |
616 |
wakaba |
1.4 |
@mv:contains: atom|title |
617 |
wakaba |
1.8 |
@mv:contains: source-prop |
618 |
|
|
@mv:contains: atom|source |
619 |
wakaba |
1.6 |
|
620 |
|
|
ModuleDef: |
621 |
|
|
@QName: AtomDatatypes |
622 |
|
|
@mv:id: datatypes |
623 |
|
|
@enLN: Datatypes |
624 |
wakaba |
1.7 |
|
625 |
|
|
@mv:contains: atomNCName |
626 |
|
|
@mv:contains: atomMediaType |
627 |
|
|
@mv:contains: atomLanguageTag |
628 |
|
|
@mv:contains: atomUri |
629 |
wakaba |
1.9 |
@mv:contains: atomUriCM |
630 |
wakaba |
1.7 |
@mv:contains: atomEmailAddress |
631 |
wakaba |
1.9 |
@mv:contains: atomEmailAddressCM |
632 |
wakaba |
1.7 |
|
633 |
wakaba |
1.8 |
@mv:contains: undefinedAttributes |
634 |
wakaba |
1.9 |
@mv:contains: undefinedContent |
635 |
wakaba |
1.7 |
@mv:contains: atomCommonAttributes |
636 |
|
|
|
637 |
wakaba |
1.8 |
@mv:contains: simpleExtensionElements |
638 |
|
|
@mv:contains: structuredExtensionElements |
639 |
|
|
@mv:contains: extensionElements |
640 |
|
|
|
641 |
wakaba |
1.6 |
@mv:contains: TextAG |
642 |
|
|
@mv:contains: TextCM |
643 |
wakaba |
1.8 |
|
644 |
|
|
@mv:contains: atom|name |
645 |
|
|
@mv:contains: atom|email |
646 |
|
|
@mv:contains: atom|uri |
647 |
wakaba |
1.6 |
@mv:contains: PersonAG |
648 |
wakaba |
1.8 |
@mv:contains: person-prop |
649 |
wakaba |
1.6 |
@mv:contains: PersonCM |
650 |
wakaba |
1.8 |
|
651 |
wakaba |
1.6 |
@mv:contains: DateAG |
652 |
|
|
@mv:contains: DateCM |
653 |
wakaba |
1.10 |
|
654 |
|
|
ResourceDef: |
655 |
|
|
@QName: AtomQName |
656 |
|
|
@enLN: Qualified Names |
657 |
|
|
@mv:id: qname |
658 |
|
|
@For: =ManakaiDOM|ManakaiDOMLatest |
659 |
|
|
@DISCore:resourceType: mv|XMLDTDQNameModule |
660 |
|
|
|
661 |
|
|
@mv:contains: Atom |
662 |
wakaba |
1.13 |
|
663 |
|
|
ResourceDef: |
664 |
|
|
@QName: Atom10 |
665 |
|
|
@enLN: Atom 1.0 |
666 |
|
|
@mv:id: atom10 |
667 |
|
|
@For: =ManakaiDOM|ManakaiDOMLatest |
668 |
|
|
@DISCore:resourceType: mv|XMLDTDDriver |
669 |
|
|
|
670 |
|
|
@mv:refers: Atom |
671 |
|
|
|
672 |
|
|
@mv:refers: AtomQName |
673 |
|
|
@mv:refers: AtomDatatypes |
674 |
|
|
@mv:refers: AtomProperties |
675 |
|
|
@mv:refers: AtomEntry |
676 |
|
|
@mv:refers: AtomFeed |
677 |
wakaba |
1.4 |
|
678 |
|
|
ElementTypeBinding: |
679 |
|
|
@Name: ModuleSetDef |
680 |
|
|
@ElementType: |
681 |
|
|
dis:ResourceDef |
682 |
|
|
@ShadowContent: |
683 |
|
|
@@DISCore:resourceType: mv|XMLDTDModuleSet |
684 |
|
|
@@For: =ManakaiDOM|ManakaiDOMLatest |
685 |
|
|
|
686 |
|
|
ElementTypeBinding: |
687 |
|
|
@Name: ModuleDef |
688 |
|
|
@ElementType: |
689 |
|
|
dis:ResourceDef |
690 |
|
|
@ShadowContent: |
691 |
|
|
@@DISCore:resourceType: mv|XMLDTDModule |
692 |
|
|
@@For: =ManakaiDOM|ManakaiDOMLatest |
693 |
wakaba |
1.1 |
|
694 |
|
|
## -- Implementation |
695 |
|
|
|
696 |
|
|
IFClsDef: |
697 |
|
|
@IFQName: AtomImplementation |
698 |
|
|
@ClsQName: ManakaiAtomImplementation |
699 |
|
|
|
700 |
wakaba |
1.15 |
@domperl:implementedByObjectsOf: c|DOMImplementation |
701 |
|
|
@domperl:classImplementedByObjectsOf: c|ManakaiDOMImplementation |
702 |
wakaba |
1.1 |
|
703 |
|
|
@enDesc: |
704 |
|
|
The <IF::AtomImplementation> interface provides convenience |
705 |
|
|
methods to create Atom documents. |
706 |
|
|
|
707 |
|
|
@f:provides: AtomFeature10 |
708 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
709 |
wakaba |
1.1 |
|
710 |
|
|
@Test: |
711 |
|
|
@@QName: AtomImplementation.interface.test |
712 |
|
|
@@PerlDef: |
713 |
|
|
for my $interface ( |
714 |
|
|
<IFName::AtomImplementation>, |
715 |
|
|
<IFName::c|DOMImplementation>, |
716 |
|
|
<IFName::f|GetFeature>, |
717 |
|
|
) { |
718 |
|
|
$test->id ($interface); |
719 |
|
|
$test->assert_true |
720 |
wakaba |
1.17 |
(<Class::c|ManakaiDOMImplementation>->isa ($interface)); |
721 |
wakaba |
1.1 |
} |
722 |
|
|
@Test: |
723 |
|
|
@@QName: ImplementationRegistry.AtomImplementation.1.test |
724 |
|
|
@@PerlDef: |
725 |
|
|
require Message::Markup::Atom; |
726 |
|
|
my $impl = $Message::DOM::ImplementationRegistry |
727 |
wakaba |
1.19 |
->get_dom_implementation ({ |
728 |
wakaba |
1.1 |
<Q::fe|Atom> => '1.0', |
729 |
|
|
}); |
730 |
|
|
|
731 |
|
|
$test->assert_isa ($impl, <IFName::AtomImplementation>); |
732 |
|
|
@Test: |
733 |
|
|
@@QName: ImplementationRegistry.AtomImplementation.2.test |
734 |
|
|
@@PerlDef: |
735 |
|
|
require Message::Markup::Atom; |
736 |
|
|
my $impl = $Message::DOM::ImplementationRegistry |
737 |
wakaba |
1.19 |
->get_dom_implementation ({ |
738 |
wakaba |
1.1 |
Core => '3.0', |
739 |
|
|
<Q::fe|Atom> => '1.0', |
740 |
|
|
}); |
741 |
|
|
|
742 |
|
|
$test->assert_isa ($impl, <IFName::AtomImplementation>); |
743 |
|
|
@Test: |
744 |
|
|
@@QName: ImplementationRegistry.AtomImplementation.3.test |
745 |
|
|
@@PerlDef: |
746 |
|
|
require Message::Markup::Atom; |
747 |
|
|
my $impl = $Message::DOM::ImplementationRegistry |
748 |
wakaba |
1.19 |
->get_dom_implementation ({ |
749 |
wakaba |
1.1 |
XML => '3.0', |
750 |
|
|
<Q::fe|Atom> => '1.0', |
751 |
|
|
}); |
752 |
|
|
|
753 |
|
|
$test->assert_isa ($impl, <IFName::AtomImplementation>); |
754 |
|
|
|
755 |
|
|
@Method: |
756 |
|
|
@@Name: createAtomFeedDocument |
757 |
|
|
@@enDesc: |
758 |
|
|
Creates an Atom Feed Document object. |
759 |
|
|
@@Param: |
760 |
|
|
@@@Name: id |
761 |
|
|
@@@Type: DOMString |
762 |
|
|
@@@actualType: DOMURI |
763 |
|
|
@@@enDesc: |
764 |
|
|
The <XE::atom|id> of the feed. |
765 |
|
|
@@Param: |
766 |
|
|
@@@Name: title |
767 |
|
|
@@@Type: DOMString |
768 |
|
|
@@@enDesc: |
769 |
|
|
The <XE::atom|title> of the feed. |
770 |
|
|
@@@nullCase: |
771 |
|
|
@@@@enDesc: |
772 |
|
|
The implementation <kwd:MUST> treate <DOM::null> |
773 |
|
|
as if an empty string is specified. |
774 |
|
|
@@Param: |
775 |
|
|
@@@Name: lang |
776 |
|
|
@@@Type: DOMString |
777 |
|
|
@@@enDesc: |
778 |
|
|
The default natural language of the feed. |
779 |
|
|
@@@nullCase: |
780 |
|
|
@@@@enDesc: |
781 |
|
|
The implementation <kwd:MUST> treate <DOM::null> |
782 |
|
|
as if an empty string is specified. |
783 |
|
|
@@Return: |
784 |
wakaba |
1.18 |
@@@Type: AtomDocument |
785 |
wakaba |
1.1 |
@@@enDesc: |
786 |
|
|
The newly created Atom Feed Document. |
787 |
|
|
|
788 |
|
|
{P:: The returned object <kwd:MUST> be a <IF::Document> node |
789 |
|
|
with attributes: |
790 |
|
|
|
791 |
|
|
- <A::Node.childNodes>::: A <IF::NodeList> containing |
792 |
|
|
a new <XE::atom|feed> element node. |
793 |
|
|
|
794 |
|
|
- <A::Document.xmlVersion>::: <XML::1.0>. |
795 |
|
|
|
796 |
|
|
} |
797 |
|
|
|
798 |
|
|
{P:: The newly created <XE::atom|feed> element node <kwd:MUST> |
799 |
|
|
have attributes set as: |
800 |
|
|
|
801 |
|
|
- <A::Node.attributes>::: A <IF::NamedNodeMap> that contains |
802 |
|
|
at least a new <XA::xml|lang> |
803 |
|
|
attribute node. |
804 |
|
|
|
805 |
|
|
- <A::Node.childNodes>::: A <IF::NodeList> containing |
806 |
|
|
a new <XE::atom|id> element node, |
807 |
|
|
a new <XE::atom|title> element node, and |
808 |
|
|
a new <XE::atom|updated> element node |
809 |
|
|
in any order. |
810 |
|
|
|
811 |
|
|
} |
812 |
|
|
|
813 |
|
|
{P:: The newly created <XA::xml|lang> attribute node <kwd:MUST> |
814 |
|
|
have attributes set as: |
815 |
|
|
|
816 |
|
|
- <A::Node.nodeValue>::: <P::lang>. |
817 |
|
|
|
818 |
|
|
- <A::Attr.specified>::: <DOM::true>. |
819 |
|
|
|
820 |
|
|
} |
821 |
|
|
|
822 |
|
|
{P:: The newly created <XE::atom|id> element node <kwd:MUST> |
823 |
|
|
have attributes set as: |
824 |
|
|
|
825 |
|
|
- <A::Node.textContent>::: <P::id>. |
826 |
|
|
|
827 |
|
|
} |
828 |
|
|
|
829 |
|
|
{P:: The newly created <XE::atom|title> element node <kwd:MUST> |
830 |
|
|
have attributes set as: |
831 |
|
|
|
832 |
|
|
- <A::Node.textContent>::: <P::title>. |
833 |
|
|
|
834 |
|
|
} |
835 |
|
|
|
836 |
|
|
The <XA::type> attribute node <kwd:MUST-NOT> be attached |
837 |
|
|
to the <XE::atom|title> element node. |
838 |
|
|
|
839 |
|
|
{P:: The newly created <XE::atom|updated> element node <kwd:MUST> |
840 |
|
|
have attributes set as: |
841 |
|
|
|
842 |
|
|
- <A::Node.textContent>::: A uppercase RFC 3339 <CODE::date-time> |
843 |
|
|
representation of the time when the method is invoked. |
844 |
|
|
The implementation <kwd:MAY> align its timezone to |
845 |
|
|
that of the environment in which the method is invoked. |
846 |
|
|
|
847 |
|
|
} |
848 |
|
|
@@@PerlDef: |
849 |
|
|
__DEEP{ |
850 |
|
|
$r = $self-><M::c|DOMImplementation.createDocument> |
851 |
|
|
(<Q::atom|>, 'feed'); |
852 |
|
|
$r-><AS::Document.xmlVersion> ('1.0'); |
853 |
|
|
|
854 |
|
|
my $feede = $r-><AG::Document.documentElement>; |
855 |
|
|
$feede-><AS::Node.manakaiLanguage> (defined $lang ? $lang : ''); |
856 |
|
|
|
857 |
|
|
$feede-><AS::AtomFeedElement.id> ($id); |
858 |
|
|
|
859 |
|
|
my $titlee = $r-><M::Document.createElementNS> (<Q::atom|>, 'title'); |
860 |
|
|
$titlee-><AS::Node.textContent> (defined $title ? $title : ''); |
861 |
|
|
$feede-><M::Node.appendChild> ($titlee); |
862 |
|
|
|
863 |
|
|
my $updatede = $r-><M::Document.createElementNS> |
864 |
|
|
(<Q::atom|>, 'updated'); |
865 |
|
|
$updatede-><AS::AtomDateConstruct.value> (scalar time); |
866 |
|
|
$feede-><M::Node.appendChild> ($updatede); |
867 |
|
|
}__; |
868 |
|
|
|
869 |
|
|
@@Test: |
870 |
|
|
@@@QName: AtomImplementation.createAtomFeedDocument.test |
871 |
|
|
@@@PerlDef: |
872 |
|
|
my $impl; |
873 |
|
|
__CODE{tc|createImplForTest:: $impl => $impl}__; |
874 |
|
|
$impl = $impl->get_feature (<Q::fe|Atom> => '1.0'); |
875 |
|
|
|
876 |
|
|
my $doc = $impl-><M::AtomImplementation.createAtomFeedDocument> |
877 |
|
|
('about:id', 'feed title', 'en'); |
878 |
|
|
|
879 |
|
|
$test->id ('document.interface'); |
880 |
|
|
$test->assert_isa ($doc, <IFName::Document>); |
881 |
|
|
|
882 |
|
|
$test->id ('document.xmlVersion'); |
883 |
|
|
$test->assert_equals ($doc-><AG::Document.xmlVersion>, '1.0'); |
884 |
|
|
|
885 |
|
|
my $feed = $doc-><AG::Document.documentElement>; |
886 |
|
|
|
887 |
|
|
$test->id ('feed.namespaceURI'); |
888 |
|
|
$test->assert_equals ($feed-><AG::Node.namespaceURI>, <Q::atom|>); |
889 |
|
|
|
890 |
|
|
$test->id ('feed.localName'); |
891 |
|
|
$test->assert_equals ($feed-><AG::Node.localName>, 'feed'); |
892 |
|
|
|
893 |
|
|
$test->id ('feed.lang'); |
894 |
|
|
$test->assert_equals ($feed-><M::Element.getAttributeNS> |
895 |
|
|
(<Q::xml|>, 'lang'), |
896 |
|
|
'en'); |
897 |
|
|
|
898 |
|
|
my $id; |
899 |
|
|
my $title; |
900 |
|
|
my $updated; |
901 |
|
|
|
902 |
|
|
for my $cn (@{$feed-><AG::Node.childNodes>}) { |
903 |
|
|
if ($cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
904 |
|
|
$cn-><AG::Node.namespaceURI> eq <Q::atom|>) { |
905 |
|
|
if ($cn-><AG::Node.localName> eq 'id') { |
906 |
|
|
$id = $cn; |
907 |
|
|
} elsif ($cn-><AG::Node.localName> eq 'title') { |
908 |
|
|
$title = $cn; |
909 |
|
|
} elsif ($cn-><AG::Node.localName> eq 'updated') { |
910 |
|
|
$updated = $cn; |
911 |
|
|
} |
912 |
|
|
} |
913 |
|
|
} |
914 |
|
|
|
915 |
|
|
$test->id ('id'); |
916 |
|
|
$test->assert_not_null ($id); |
917 |
|
|
|
918 |
|
|
$test->id ('id.value'); |
919 |
|
|
$test->assert_equals ($id-><AG::Node.textContent>, 'about:id'); |
920 |
|
|
|
921 |
|
|
$test->id ('title'); |
922 |
|
|
$test->assert_not_null ($title); |
923 |
|
|
|
924 |
|
|
$test->id ('title.value'); |
925 |
|
|
$test->assert_equals ($title-><AG::Node.textContent>, 'feed title'); |
926 |
|
|
|
927 |
|
|
$test->id ('title.type'); |
928 |
|
|
$test->assert_null ($title-><M::Element.getAttributeNS> (null, 'type')); |
929 |
|
|
|
930 |
|
|
$test->id ('updated'); |
931 |
|
|
$test->assert_not_null ($updated); |
932 |
|
|
|
933 |
|
|
$test->id ('updated.value'); |
934 |
|
|
$test->assert_num_not_equals |
935 |
|
|
(actual_value => $updated-><AG::AtomDateConstruct.value>, |
936 |
|
|
expected_value => 0); |
937 |
|
|
|
938 |
|
|
@Method: |
939 |
|
|
@@Name: createAtomEntryDocument |
940 |
|
|
@@enDesc: |
941 |
|
|
Creates an Atom Entry Document object. |
942 |
|
|
@@Param: |
943 |
|
|
@@@Name: id |
944 |
|
|
@@@Type: DOMString |
945 |
|
|
@@@actualType: DOMURI |
946 |
|
|
@@@enDesc: |
947 |
|
|
The <XE::atom|id> of the entry. |
948 |
|
|
@@Param: |
949 |
|
|
@@@Name: title |
950 |
|
|
@@@Type: DOMString |
951 |
|
|
@@@enDesc: |
952 |
|
|
The <XE::atom|title> of the entry. |
953 |
|
|
@@@nullCase: |
954 |
|
|
@@@@enDesc: |
955 |
|
|
The implementation <kwd:MUST> treate <DOM::null> |
956 |
|
|
as if an empty string is specified. |
957 |
|
|
@@Param: |
958 |
|
|
@@@Name: lang |
959 |
|
|
@@@Type: DOMString |
960 |
|
|
@@@enDesc: |
961 |
|
|
The natural language of the entry. |
962 |
|
|
@@@nullCase: |
963 |
|
|
@@@@enDesc: |
964 |
|
|
The implementation <kwd:MUST> treate <DOM::null> |
965 |
|
|
as if an empty string is specified. |
966 |
|
|
@@Return: |
967 |
wakaba |
1.18 |
@@@Type: AtomDocument |
968 |
wakaba |
1.1 |
@@@enDesc: |
969 |
|
|
The newly created Atom Entry Document. |
970 |
|
|
|
971 |
|
|
{P:: The returned object <kwd:MUST> be a <IF::Document> node |
972 |
|
|
with attributes: |
973 |
|
|
|
974 |
|
|
- <A::Node.childNodes>::: A <IF::NodeList> containing |
975 |
|
|
a new <XE::atom|entry> element node. |
976 |
|
|
|
977 |
|
|
- <A::Document.xmlVersion>::: <XML::1.0>. |
978 |
|
|
|
979 |
|
|
} |
980 |
|
|
|
981 |
|
|
{P:: The newly created <XE::atom|entry> element node <kwd:MUST> |
982 |
|
|
have attributes set as: |
983 |
|
|
|
984 |
|
|
- <A::Node.attributes>::: A <IF::NamedNodeMap> that contains |
985 |
|
|
at least a new <XA::xml|lang> |
986 |
|
|
attribute node. |
987 |
|
|
|
988 |
|
|
- <A::Node.childNodes>::: A <IF::NodeList> containing |
989 |
|
|
a new <XE::atom|id> element node, |
990 |
|
|
a new <XE::atom|title> element node, and |
991 |
|
|
a new <XE::atom|updated> element node |
992 |
|
|
in any order. |
993 |
|
|
|
994 |
|
|
} |
995 |
|
|
|
996 |
|
|
{P:: The newly created <XA::xml|lang> attribute node <kwd:MUST> |
997 |
|
|
have attributes set as: |
998 |
|
|
|
999 |
|
|
- <A::Node.nodeValue>::: <P::lang>. |
1000 |
|
|
|
1001 |
|
|
- <A::Attr.specified>::: <DOM::true>. |
1002 |
|
|
|
1003 |
|
|
} |
1004 |
|
|
|
1005 |
|
|
{P:: The newly created <XE::atom|id> element node <kwd:MUST> |
1006 |
|
|
have attributes set as: |
1007 |
|
|
|
1008 |
|
|
- <A::Node.textContent>::: <P::id>. |
1009 |
|
|
|
1010 |
|
|
} |
1011 |
|
|
|
1012 |
|
|
{P:: The newly created <XE::atom|title> element node <kwd:MUST> |
1013 |
|
|
have attributes set as: |
1014 |
|
|
|
1015 |
|
|
- <A::Node.textContent>::: <P::title>. |
1016 |
|
|
|
1017 |
|
|
} |
1018 |
|
|
|
1019 |
|
|
The <XA::type> attribute node <kwd:MUST-NOT> be attached |
1020 |
|
|
to the <XE::atom|title> element node. |
1021 |
|
|
|
1022 |
|
|
{P:: The newly created <XE::atom|updated> element node <kwd:MUST> |
1023 |
|
|
have attributes set as: |
1024 |
|
|
|
1025 |
|
|
- <A::Node.textContent>::: A uppercase RFC 3339 <CODE::date-time> |
1026 |
|
|
representation of the time when the method is invoked. |
1027 |
|
|
The implementation <kwd:MAY> align its timezone to |
1028 |
|
|
that of the environment in which the method is invoked. |
1029 |
|
|
|
1030 |
|
|
} |
1031 |
|
|
@@@PerlDef: |
1032 |
|
|
__DEEP{ |
1033 |
|
|
$r = $self-><M::c|DOMImplementation.createDocument> |
1034 |
|
|
(<Q::atom|>, 'entry'); |
1035 |
|
|
$r-><AS::Document.xmlVersion> ('1.0'); |
1036 |
|
|
|
1037 |
|
|
my $feede = $r-><AG::Document.documentElement>; |
1038 |
|
|
$feede-><AS::Node.manakaiLanguage> (defined $lang ? $lang : ''); |
1039 |
|
|
|
1040 |
|
|
$feede-><AS::AtomFeedElement.id> ($id); |
1041 |
|
|
|
1042 |
|
|
my $titlee = $r-><M::Document.createElementNS> (<Q::atom|>, 'title'); |
1043 |
|
|
$titlee-><AS::Node.textContent> (defined $title ? $title : ''); |
1044 |
|
|
$feede-><M::Node.appendChild> ($titlee); |
1045 |
|
|
|
1046 |
|
|
my $updatede = $r-><M::Document.createElementNS> |
1047 |
|
|
(<Q::atom|>, 'updated'); |
1048 |
|
|
$updatede-><AS::AtomDateConstruct.value> (scalar time); |
1049 |
|
|
$feede-><M::Node.appendChild> ($updatede); |
1050 |
|
|
}__; |
1051 |
|
|
|
1052 |
|
|
@@Test: |
1053 |
|
|
@@@QName: AtomImplementation.createAtomEntryDocument.test |
1054 |
|
|
@@@PerlDef: |
1055 |
|
|
my $impl; |
1056 |
|
|
__CODE{tc|createImplForTest:: $impl => $impl}__; |
1057 |
|
|
$impl = $impl->get_feature (<Q::fe|Atom> => '1.0'); |
1058 |
|
|
|
1059 |
|
|
my $doc = $impl-><M::AtomImplementation.createAtomEntryDocument> |
1060 |
|
|
('about:id', 'entry title', 'en'); |
1061 |
|
|
|
1062 |
|
|
$test->id ('document.interface'); |
1063 |
|
|
$test->assert_isa ($doc, <IFName::Document>); |
1064 |
|
|
|
1065 |
|
|
$test->id ('document.xmlVersion'); |
1066 |
|
|
$test->assert_equals ($doc-><AG::Document.xmlVersion>, '1.0'); |
1067 |
|
|
|
1068 |
|
|
my $feed = $doc-><AG::Document.documentElement>; |
1069 |
|
|
|
1070 |
|
|
$test->id ('feed.namespaceURI'); |
1071 |
|
|
$test->assert_equals ($feed-><AG::Node.namespaceURI>, <Q::atom|>); |
1072 |
|
|
|
1073 |
|
|
$test->id ('feed.localName'); |
1074 |
|
|
$test->assert_equals ($feed-><AG::Node.localName>, 'entry'); |
1075 |
|
|
|
1076 |
|
|
$test->id ('feed.lang'); |
1077 |
|
|
$test->assert_equals ($feed-><M::Element.getAttributeNS> |
1078 |
|
|
(<Q::xml|>, 'lang'), |
1079 |
|
|
'en'); |
1080 |
|
|
|
1081 |
|
|
my $id; |
1082 |
|
|
my $title; |
1083 |
|
|
my $updated; |
1084 |
|
|
|
1085 |
|
|
for my $cn (@{$feed-><AG::Node.childNodes>}) { |
1086 |
|
|
if ($cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
1087 |
|
|
$cn-><AG::Node.namespaceURI> eq <Q::atom|>) { |
1088 |
|
|
if ($cn-><AG::Node.localName> eq 'id') { |
1089 |
|
|
$id = $cn; |
1090 |
|
|
} elsif ($cn-><AG::Node.localName> eq 'title') { |
1091 |
|
|
$title = $cn; |
1092 |
|
|
} elsif ($cn-><AG::Node.localName> eq 'updated') { |
1093 |
|
|
$updated = $cn; |
1094 |
|
|
} |
1095 |
|
|
} |
1096 |
|
|
} |
1097 |
|
|
|
1098 |
|
|
$test->id ('id'); |
1099 |
|
|
$test->assert_not_null ($id); |
1100 |
|
|
|
1101 |
|
|
$test->id ('id.value'); |
1102 |
|
|
$test->assert_equals ($id-><AG::Node.textContent>, 'about:id'); |
1103 |
|
|
|
1104 |
|
|
$test->id ('title'); |
1105 |
|
|
$test->assert_not_null ($title); |
1106 |
|
|
|
1107 |
|
|
$test->id ('title.value'); |
1108 |
|
|
$test->assert_equals ($title-><AG::Node.textContent>, 'entry title'); |
1109 |
|
|
|
1110 |
|
|
$test->id ('title.type'); |
1111 |
|
|
$test->assert_null ($title-><M::Element.getAttributeNS> (null, 'type')); |
1112 |
|
|
|
1113 |
|
|
$test->id ('updated'); |
1114 |
|
|
$test->assert_not_null ($updated); |
1115 |
|
|
|
1116 |
|
|
$test->id ('updated.value'); |
1117 |
|
|
$test->assert_num_not_equals |
1118 |
|
|
(actual_value => $updated-><AG::AtomDateConstruct.value>, |
1119 |
|
|
expected_value => 0); |
1120 |
|
|
|
1121 |
|
|
@enImplNote: |
1122 |
|
|
@@ddid: imt |
1123 |
|
|
@@@: |
1124 |
|
|
{ISSUE:: |
1125 |
|
|
The <CODE::contentType> attribute of the created document |
1126 |
|
|
should be set to <CODE::application/atom+xml>? |
1127 |
|
|
} |
1128 |
|
|
|
1129 |
|
|
@CODE: |
1130 |
|
|
@@QName: returnChildElement |
1131 |
|
|
@@enDesc: |
1132 |
|
|
{P:: The algorithm to <DFN::return <VAR::element-type> child |
1133 |
|
|
element> of the element node <VAR::E> is defined as: |
1134 |
|
|
|
1135 |
|
|
= If <VAR::E> contains one or more child element node |
1136 |
|
|
whose element type is <VAR::element-type>, |
1137 |
|
|
it <kwd:MUST> return the first such element node |
1138 |
|
|
in document order. |
1139 |
|
|
|
1140 |
|
|
{OLI:: Otherwise, |
1141 |
|
|
|
1142 |
|
|
{OLI:: If the <cfg::cfg|create-child-element> configuration |
1143 |
|
|
parameter is set to <DOM::true>, |
1144 |
|
|
|
1145 |
|
|
= Create an element node <VAR::N> whose element type |
1146 |
|
|
is <VAR::element-type>. |
1147 |
|
|
|
1148 |
|
|
= Append <VAR::N> to <VAR::E> as if the <M::Node.appendChild> |
1149 |
|
|
method were called for <VAR::E> with its parameter |
1150 |
|
|
set to <VAR::N>. Note that this might throw an exception. |
1151 |
|
|
|
1152 |
|
|
= Then, <VAR::N> <kwd:MUST> be returned. |
1153 |
|
|
|
1154 |
|
|
} |
1155 |
|
|
|
1156 |
|
|
= Otherwise, <DOM::null> <kwd:MUST> be returned. |
1157 |
|
|
|
1158 |
|
|
} |
1159 |
|
|
|
1160 |
|
|
} |
1161 |
|
|
@@PerlDef: |
1162 |
|
|
__DEEP{ |
1163 |
|
|
E: { |
1164 |
|
|
no warnings 'uninitialized'; |
1165 |
|
|
for my $__el (@{$node-><AG::Node.childNodes>}) { |
1166 |
|
|
if ($__el-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
1167 |
|
|
$__el-><AG::Node.localName> eq $localName and |
1168 |
|
|
$__el-><AG::Node.namespaceURI> eq $namespaceURI) { |
1169 |
|
|
$r = $__el; |
1170 |
|
|
last E; |
1171 |
|
|
} |
1172 |
|
|
} |
1173 |
|
|
|
1174 |
|
|
my $od = $node-><AG::Node.ownerDocument>; |
1175 |
|
|
if ($od-><AG::Document.domConfig> |
1176 |
|
|
-><M::CFG.getParameter> (<Q::cfg|create-child-element>)) { |
1177 |
|
|
$r = $od-><M::Document.createElementNS> ($namespaceURI, $localName); |
1178 |
|
|
$node-><M::Node.appendChild> ($r); |
1179 |
|
|
} |
1180 |
|
|
} # E |
1181 |
|
|
}__; |
1182 |
|
|
|
1183 |
|
|
@CODE: |
1184 |
|
|
@@QName: returnChildElementList |
1185 |
|
|
@@enDesc: |
1186 |
|
|
{P:: The algorithm to <DFN::return <VAR::element-type> child |
1187 |
|
|
element list> of the element node <VAR::E> is defined as: |
1188 |
|
|
|
1189 |
|
|
= Creates an empty <IF::StaticNodeList> object <VAR::L> |
1190 |
|
|
that is <EM::not> read-only. |
1191 |
|
|
|
1192 |
|
|
= For each child element node of <VAR::E>, |
1193 |
|
|
add that element node to <VAR::L> in document order |
1194 |
|
|
if its element type is <VAR::element-type>. |
1195 |
|
|
|
1196 |
|
|
= Returns <VAR::E>. |
1197 |
|
|
|
1198 |
|
|
} |
1199 |
|
|
@@PerlDef: |
1200 |
|
|
__DEEP{ |
1201 |
|
|
no warnings 'uninitialized'; |
1202 |
|
|
__CODE{tc|createStaticNodeList:: $r => $r}__; |
1203 |
|
|
for my $__el (@{$node-><AG::Node.childNodes>}) { |
1204 |
|
|
if ($__el-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
1205 |
|
|
$__el-><AG::Node.localName> eq $localName and |
1206 |
|
|
$__el-><AG::Node.namespaceURI> eq $namespaceURI) { |
1207 |
|
|
push @{$r}, $__el; |
1208 |
|
|
} |
1209 |
|
|
} |
1210 |
|
|
}__; |
1211 |
|
|
|
1212 |
|
|
@CODE: |
1213 |
|
|
@@QName: getReflectStringValue |
1214 |
|
|
@@enDesc: |
1215 |
|
|
{P:: If a DOM attribute is defined to <DFN::reflect the string value |
1216 |
|
|
of the <VAR::element-type> child element> of the node <VAR::E>, |
1217 |
|
|
the getter of the attribute <kwd:MUST> return the value |
1218 |
|
|
defined by the algorithm: |
1219 |
|
|
|
1220 |
|
|
= If the <VAR::E> contains a child element node <VAR::C> whose element |
1221 |
|
|
type is <VAR::element-type>, it <kwd:MUST> return |
1222 |
|
|
the <A::Node.textContent> value of the <VAR::C>. |
1223 |
|
|
|
1224 |
|
|
= Otherwise, it <kwd:MUST> return <DOM::null>. |
1225 |
|
|
|
1226 |
|
|
} |
1227 |
|
|
@@PerlDef: |
1228 |
|
|
__DEEP{ |
1229 |
|
|
E: { |
1230 |
|
|
no warnings 'uninitialized'; |
1231 |
|
|
for my $__cn (@{$node-><AG::Node.childNodes>}) { |
1232 |
|
|
if ($__cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
1233 |
|
|
$__cn-><AG::Node.localName> eq $localName and |
1234 |
|
|
$__cn-><AG::Node.namespaceURI> eq $namespaceURI) { |
1235 |
|
|
$r = $__cn-><AG::Node.textContent>; |
1236 |
|
|
last E; |
1237 |
|
|
} |
1238 |
|
|
} |
1239 |
|
|
$r = null; |
1240 |
|
|
} # E |
1241 |
|
|
}__; |
1242 |
|
|
|
1243 |
|
|
@CODE: |
1244 |
|
|
@@QName: setReflectStringValue |
1245 |
|
|
@@enDesc: |
1246 |
|
|
{P:: If a DOM attribute is defined to <DFN::reflect the string value |
1247 |
|
|
of the <VAR::element-type> child element> of the node <VAR::E>, |
1248 |
|
|
the setter of the attribute <kwd:MUST> modify the node as |
1249 |
|
|
defined by the algorithm: |
1250 |
|
|
|
1251 |
|
|
= If the given value is <DOM::null>, any child elements |
1252 |
|
|
whose element types are <VAR::element-type> <kwd:MUST> |
1253 |
|
|
be removed from the list of child nodes. |
1254 |
|
|
|
1255 |
|
|
= Otherwise, if there is no <VAR::element-type> child element |
1256 |
|
|
node in the child node list of the <VAR::E>, it |
1257 |
|
|
<kwd:MUST> create an element node whose element type |
1258 |
|
|
is <VAR::element-type>, append it to the <VAR::E> as |
1259 |
|
|
if the <M::Node.appendChild> method were invoked, and |
1260 |
|
|
set the <A::Node.textContent> of the newly created |
1261 |
|
|
element node to the given value. |
1262 |
|
|
|
1263 |
|
|
= Otherwise, it <kwd:MUST> set the <A::Node.textContent> |
1264 |
|
|
of the first <VAR::element-type> child element node |
1265 |
|
|
in the child node list of the <VAR::E> to the given value. |
1266 |
|
|
|
1267 |
|
|
} |
1268 |
|
|
|
1269 |
|
|
{NOTE:: |
1270 |
|
|
It might throw an exception. |
1271 |
|
|
} |
1272 |
|
|
@@PerlDef: |
1273 |
|
|
__DEEP{ |
1274 |
|
|
no warnings 'uninitialized'; |
1275 |
|
|
if (defined $given) { |
1276 |
|
|
my $__target; |
1277 |
|
|
E: { |
1278 |
|
|
for my $__cl (@{$node-><AG::Node.childNodes>}) { |
1279 |
|
|
if ($__cl-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
1280 |
|
|
$__cl-><AG::Node.localName> eq $localName and |
1281 |
|
|
$__cl-><AG::Node.namespaceURI> eq $namespaceURI) { |
1282 |
|
|
$__target = $__cl; |
1283 |
|
|
last E; |
1284 |
|
|
} |
1285 |
|
|
} |
1286 |
|
|
|
1287 |
|
|
$__target = $node-><AG::Node.ownerDocument> |
1288 |
|
|
-><M::Document.createElementNS> |
1289 |
|
|
($namespaceURI, $localName); |
1290 |
|
|
$node-><M::Node.appendChild> ($__target); |
1291 |
|
|
} # E |
1292 |
|
|
|
1293 |
|
|
$__target-><AS::Node.textContent> ($given); |
1294 |
|
|
} else { |
1295 |
|
|
my @__remove; |
1296 |
|
|
for my $__cl (@{$node-><AG::Node.childNodes>}) { |
1297 |
|
|
if ($__cl-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
1298 |
|
|
$__cl-><AG::Node.localName> eq $localName and |
1299 |
|
|
$__cl-><AG::Node.namespaceURI> eq $namespaceURI) { |
1300 |
|
|
push @__remove, $__cl; |
1301 |
|
|
} |
1302 |
|
|
} |
1303 |
|
|
$node-><M::Node.removeChild> ($_) for @__remove; |
1304 |
|
|
} |
1305 |
|
|
}__; |
1306 |
|
|
|
1307 |
|
|
@CODE: |
1308 |
|
|
@@QName: getReflectAttrStringValue |
1309 |
|
|
@@enDesc: |
1310 |
|
|
{P:: If a DOM attribute is defined to <DFN::reflect the string value |
1311 |
|
|
of the <VAR::attr-name> attribute> of the node <VAR::E>, |
1312 |
|
|
the getter of the attribute <kwd:MUST> return the value |
1313 |
|
|
defined by the algorithm: |
1314 |
|
|
|
1315 |
|
|
= If the <VAR::E> contains an attribute node <VAR::A> whose name |
1316 |
|
|
is <VAR::attr-name>, it <kwd:MUST> return |
1317 |
|
|
the <A::Node.nodeValue> of the <VAR::A>. |
1318 |
|
|
|
1319 |
|
|
= If a default value is explicitly defined |
1320 |
|
|
where this algorithm is referenced, it <kwd:MUST> |
1321 |
|
|
return the default value. |
1322 |
|
|
|
1323 |
|
|
= Otherwise, it <kwd:MUST> return <DOM::null>. |
1324 |
|
|
|
1325 |
|
|
} |
1326 |
|
|
@@PerlDef: |
1327 |
|
|
__DEEP{ |
1328 |
|
|
E: { |
1329 |
|
|
$r = $node-><M::Element.getAttributeNS> ($namespaceURI, $localName); |
1330 |
|
|
last E if defined $r; |
1331 |
|
|
|
1332 |
|
|
$r = $defaultValue; |
1333 |
|
|
} # E |
1334 |
|
|
}__; |
1335 |
|
|
|
1336 |
|
|
@CODE: |
1337 |
|
|
@@QName: setReflectAttrStringValue |
1338 |
|
|
@@enDesc: |
1339 |
|
|
{P:: If a DOM attribute is defined to <DFN::reflect the string value |
1340 |
|
|
of the <VAR::attr-name> attribute> of the node <VAR::E>, |
1341 |
|
|
the setter of the attribute <kwd:MUST> modify the node as |
1342 |
|
|
defined by the algorithm: |
1343 |
|
|
|
1344 |
|
|
= If the given value is <DOM::null>, it <kwd:MUST> |
1345 |
|
|
remove the <VAR::attr-name> attribute node, if any, |
1346 |
|
|
from the list of attribute nodes of <VAR::E>. |
1347 |
|
|
|
1348 |
|
|
= Otherwise, it <kwd:MUST> set the <VAR::attr-name> |
1349 |
|
|
attribute node value to the given value as if |
1350 |
|
|
the <M::Element.setAttributeNS> method were invoked. |
1351 |
|
|
|
1352 |
|
|
} |
1353 |
|
|
|
1354 |
|
|
{NOTE:: |
1355 |
|
|
It might throw an exception. |
1356 |
|
|
} |
1357 |
|
|
@@PerlDef: |
1358 |
|
|
__DEEP{ |
1359 |
|
|
if (defined $given) { |
1360 |
|
|
$node-><M::Element.setAttributeNS> ($namespaceURI, $localName, $given); |
1361 |
|
|
} else { |
1362 |
|
|
$node-><M::Element.removeAttributeNS> ($namespaceURI, $localName); |
1363 |
|
|
} |
1364 |
|
|
}__; |
1365 |
|
|
|
1366 |
|
|
@CODE: |
1367 |
|
|
@@QName: getReflectURIValue |
1368 |
|
|
@@enDesc: |
1369 |
|
|
{P:: If a DOM attribute is defined to <DFN::reflect the URI value |
1370 |
|
|
of the <VAR::element-type> child element> of the node <VAR::E>, |
1371 |
|
|
the getter of the attribute <kwd:MUST> return the value |
1372 |
|
|
defined by the algorithm: |
1373 |
|
|
|
1374 |
|
|
= Get the string <VAR::S> that would be returned |
1375 |
|
|
if the DOM attribute <I::reflects the string value |
1376 |
|
|
of the <VAR::element-type> child element> of the <VAR::E>. |
1377 |
|
|
|
1378 |
|
|
= If the <VAR::S> is <DOM::null>, it <kwd:MUST> return |
1379 |
|
|
<DOM::null>. |
1380 |
|
|
|
1381 |
|
|
= Otherwise, if the <A::Node.baseURI> of the node |
1382 |
|
|
from which the <VAR::S> comes is <DOM::null>, |
1383 |
|
|
it <kwd:MUST> return the <VAR::S>. |
1384 |
|
|
|
1385 |
|
|
= Otherwise, a string that would be returned by the |
1386 |
|
|
<M::urigen|URIReference.getAbsoluteReference> |
1387 |
|
|
method on a <IF::urigen|URIReference> object whose |
1388 |
|
|
<A::urigen|URIReference.uriReference> value |
1389 |
|
|
equals to <A::Node.textContent> with the <CODE::base> parameter |
1390 |
|
|
set to the <A::Node.baseURI> of the node |
1391 |
|
|
from which the <VAR::S> comes and the <CODE::nonStrict> |
1392 |
|
|
parameter set to <DOM::false>. |
1393 |
|
|
|
1394 |
|
|
} |
1395 |
|
|
@@PerlDef: |
1396 |
|
|
__DEEP{ |
1397 |
|
|
E: { |
1398 |
|
|
no warnings 'uninitialized'; |
1399 |
|
|
for my $__cn (@{$node-><AG::Node.childNodes>}) { |
1400 |
|
|
if ($__cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
1401 |
|
|
$__cn-><AG::Node.localName> eq $localName and |
1402 |
|
|
$__cn-><AG::Node.namespaceURI> eq $namespaceURI) { |
1403 |
|
|
my $__ref_buri = $__cn-><AG::Node.baseURI>; |
1404 |
|
|
if (defined $__ref_buri) { |
1405 |
|
|
$r = $node-><AG::Node.ownerDocument> |
1406 |
|
|
-><AG::Document.implementation> |
1407 |
|
|
-><M::urigen|URIImplementation.createURIReference> |
1408 |
|
|
($__cn-><AG::Node.textContent>) |
1409 |
|
|
-><M::urigen|URIReference.getAbsoluteReference> |
1410 |
|
|
($__ref_buri) |
1411 |
|
|
-><AG::urigen|URIReference.uriReference>; |
1412 |
|
|
} else { |
1413 |
|
|
$r = $__cn-><AG::Node.textContent>; |
1414 |
|
|
} |
1415 |
|
|
last E; |
1416 |
|
|
} |
1417 |
|
|
} |
1418 |
|
|
$r = null; |
1419 |
|
|
} # E |
1420 |
|
|
}__; |
1421 |
|
|
|
1422 |
|
|
@CODE: |
1423 |
|
|
@@QName: setReflectURIValue |
1424 |
|
|
@@enDesc: |
1425 |
|
|
If a DOM attribute is defined to <DFN::reflect the URI value |
1426 |
|
|
of the <VAR::element-type> child element> of the node <VAR::E>, |
1427 |
|
|
the setter of the attribute <kwd:MUST> modify the node as |
1428 |
|
|
if the DOM attribute <I::reflects the string value of |
1429 |
|
|
the <VAR::element-type> child element> of the <VAR::E>. |
1430 |
|
|
|
1431 |
|
|
{NOTE:: |
1432 |
|
|
It might throw an exception. |
1433 |
|
|
} |
1434 |
|
|
@@PerlDef: |
1435 |
|
|
__CODE{setReflectStringValue}__; |
1436 |
|
|
|
1437 |
|
|
@CODE: |
1438 |
|
|
@@QName: getReflectAttrURIValue |
1439 |
|
|
@@enDesc: |
1440 |
|
|
{P:: If a DOM attribute is defined to <DFN::reflect the URI value |
1441 |
|
|
of the <VAR::attr-name> attribute> of the node <VAR::E>, |
1442 |
|
|
the getter of the attribute <kwd:MUST> return the value |
1443 |
|
|
defined by the algorithm: |
1444 |
|
|
|
1445 |
|
|
= Get the string <VAR::S> that would be returned |
1446 |
|
|
if the DOM attribute <I::reflects the string value |
1447 |
|
|
of the <VAR::attr-name> attribute> of the <VAR::E>. |
1448 |
|
|
|
1449 |
|
|
= If the <VAR::S> is <DOM::null>, it <kwd:MUST> return |
1450 |
|
|
<DOM::null>. |
1451 |
|
|
|
1452 |
|
|
= Otherwise, if the <A::Node.baseURI> of the node |
1453 |
|
|
from which the <VAR::S> comes is <DOM::null>, |
1454 |
|
|
it <kwd:MUST> return the <VAR::S>. |
1455 |
|
|
|
1456 |
|
|
= Otherwise, a string that would be returned by the |
1457 |
|
|
<M::urigen|URIReference.getAbsoluteReference> |
1458 |
|
|
method on a <IF::urigen|URIReference> object whose |
1459 |
|
|
<A::urigen|URIReference.uriReference> value |
1460 |
|
|
equals to <A::Node.textContent> with the <CODE::base> parameter |
1461 |
|
|
set to the <A::Node.baseURI> of the node |
1462 |
|
|
from which the <VAR::S> comes and the <CODE::nonStrict> |
1463 |
|
|
parameter set to <DOM::false>. |
1464 |
|
|
|
1465 |
|
|
} |
1466 |
|
|
@@PerlDef: |
1467 |
|
|
__DEEP{ |
1468 |
|
|
my $__attr = $node-><M::Element.getAttributeNodeNS> |
1469 |
|
|
($namespaceURI, $localName); |
1470 |
|
|
if (defined $__attr) { |
1471 |
|
|
my $__attr_base = $__attr-><AG::Node.baseURI>; |
1472 |
|
|
if (defined $__attr_base) { |
1473 |
|
|
$r = $node-><AG::Node.ownerDocument> |
1474 |
|
|
-><AG::Document.implementation> |
1475 |
|
|
-><M::urigen|URIImplementation.createURIReference> |
1476 |
|
|
($__attr-><AG::Node.nodeValue>) |
1477 |
|
|
-><M::urigen|URIReference.getAbsoluteReference> |
1478 |
|
|
($__attr_base) |
1479 |
|
|
-><AG::urigen|URIReference.uriReference>; |
1480 |
|
|
} else { |
1481 |
|
|
$r = $__attr-><AG::Node.nodeValue>; |
1482 |
|
|
} |
1483 |
|
|
} else { |
1484 |
|
|
$r = null; |
1485 |
|
|
} |
1486 |
|
|
}__; |
1487 |
|
|
|
1488 |
|
|
@CODE: |
1489 |
|
|
@@QName: setReflectAttrURIValue |
1490 |
|
|
@@enDesc: |
1491 |
|
|
If a DOM attribute is defined to <DFN::reflect the URI value |
1492 |
|
|
of the <VAR::attr-name> attribute> of the node <VAR::E>, |
1493 |
|
|
the setter of the DOM attribute <kwd:MUST> modify the node as |
1494 |
|
|
if the DOM attribute <I::reflects the string value of |
1495 |
|
|
the <VAR::attr-name> attribute> of the <VAR::E>. |
1496 |
|
|
|
1497 |
|
|
{NOTE:: |
1498 |
|
|
It might throw an exception. |
1499 |
|
|
} |
1500 |
|
|
@@PerlDef: |
1501 |
|
|
__CODE{setReflectAttrStringValue}__; |
1502 |
|
|
|
1503 |
|
|
@enImplNote: |
1504 |
|
|
@@ddid: datereflect |
1505 |
|
|
@@@: |
1506 |
|
|
{ISSUE:: |
1507 |
|
|
<QUOTE::reflecting Date child element> attribute should |
1508 |
|
|
be provided for published and created? |
1509 |
|
|
} |
1510 |
wakaba |
1.14 |
|
1511 |
|
|
@CODE: |
1512 |
|
|
@@QName: getReflectAttrNonNegativeIntegerValue |
1513 |
|
|
@@enDesc: |
1514 |
|
|
{P:: If a DOM attribute is defined to <DFN::reflect the |
1515 |
|
|
non-negative integer value of the <VAR::attr-name> attribute> |
1516 |
|
|
of the node <VAR::E>, the getter of the attribute <kwd:MUST> |
1517 |
|
|
return the value defined by the algorithm: |
1518 |
|
|
|
1519 |
|
|
{OLI:: If the <VAR::E> contains an attribute node <VAR::A> whose name |
1520 |
|
|
is <VAR::attr-name>: |
1521 |
|
|
|
1522 |
|
|
= If the <A::Node.nodeValue> of the <VAR::A> is |
1523 |
|
|
one or more sequence of digits (<CHAR::DIGIT ZERO>, |
1524 |
|
|
<CHAR::DIGIT ONE>, ..., <CHAR::DIGIT NINE>) optionally |
1525 |
|
|
preceding by a <CHAR::PLUS SIGN>, then |
1526 |
|
|
the attribute getter <kwd:MUST> return a value |
1527 |
|
|
by interpreting the <A::Node.nodeValue> of the <VAR::A> |
1528 |
|
|
as a decimal number. |
1529 |
|
|
|
1530 |
|
|
} |
1531 |
|
|
|
1532 |
|
|
= If a default value is explicitly defined |
1533 |
|
|
where this algorithm is referenced, it <kwd:MUST> |
1534 |
|
|
return the default value. |
1535 |
|
|
|
1536 |
|
|
= Otherwise, it <kwd:MUST> return a binding-specific |
1537 |
|
|
default value, if it is defined by the specification |
1538 |
|
|
of the binding, or <DOM::-1>. |
1539 |
|
|
|
1540 |
|
|
} |
1541 |
|
|
|
1542 |
|
|
{NOTE:: |
1543 |
|
|
In Atom Threading Extension <SRC::RFC 4685>, |
1544 |
|
|
the <CHAR::PLUS SIGN> and leading <CHAR::DIGIT ZERO>s |
1545 |
|
|
are prohibitted. |
1546 |
|
|
} |
1547 |
|
|
@@PerlDef: |
1548 |
|
|
__DEEP{ |
1549 |
|
|
E: { |
1550 |
|
|
$r = $node-><M::Element.getAttributeNS> ($namespaceURI, $localName); |
1551 |
|
|
if (defined $r) { |
1552 |
|
|
if ($r =~ /\A\+?([0-9]+)\z/) { |
1553 |
|
|
$r = 0+$1; |
1554 |
|
|
last E; |
1555 |
|
|
} |
1556 |
|
|
} |
1557 |
|
|
|
1558 |
|
|
$r = $defaultValue; |
1559 |
|
|
$r = -1 unless defined $r; |
1560 |
|
|
} # E |
1561 |
|
|
}__; |
1562 |
|
|
|
1563 |
|
|
@CODE: |
1564 |
|
|
@@QName: setReflectAttrNonNegativeIntegerValue |
1565 |
|
|
@@enDesc: |
1566 |
|
|
{P:: If a DOM attribute is defined to <DFN::reflect the |
1567 |
|
|
non-negative integer value |
1568 |
|
|
of the <VAR::attr-name> attribute> of the node <VAR::E>, |
1569 |
|
|
the setter of the attribute <kwd:MUST> modify the node as |
1570 |
|
|
defined by the algorithm: |
1571 |
|
|
|
1572 |
|
|
= If the given value is <DOM::-1> or one of binding-specific |
1573 |
|
|
default values, if any, as defined by the specification |
1574 |
|
|
of the binding, it <kwd:MUST> |
1575 |
|
|
remove the <VAR::attr-name> attribute node, if any, |
1576 |
|
|
from the list of attribute nodes of <VAR::E>. |
1577 |
|
|
|
1578 |
|
|
= Otherwise, it <kwd:MUST> set the <VAR::attr-name> |
1579 |
|
|
attribute node value to a string representation |
1580 |
|
|
of the given value as if |
1581 |
|
|
the <M::Element.setAttributeNS> method were invoked. |
1582 |
|
|
The string representation <kwd:MUST> be a decimal |
1583 |
|
|
number consist of one or more sequence of digits |
1584 |
|
|
(<CHAR::DIGIT ZERO>, <CHAR::DIGIT ONE>, ..., <CHAR::DIGIT NINE>) |
1585 |
|
|
<EM::without> any leading <CHAR::DIGIT ZERO>. |
1586 |
|
|
The <CHAR::PLUS SIGN> <kwd:MUST> be omitted. |
1587 |
|
|
|
1588 |
|
|
} |
1589 |
|
|
|
1590 |
|
|
{NOTE:: |
1591 |
|
|
It might throw an exception. |
1592 |
|
|
} |
1593 |
|
|
@@PerlDef: |
1594 |
|
|
__DEEP{ |
1595 |
|
|
if (defined $given and $given >= 0) { |
1596 |
|
|
$node-><M::Element.setAttributeNS> |
1597 |
|
|
($namespaceURI, $localName, 0+$given); |
1598 |
|
|
} else { |
1599 |
|
|
$node-><M::Element.removeAttributeNS> ($namespaceURI, $localName); |
1600 |
|
|
} |
1601 |
|
|
}__; |
1602 |
wakaba |
1.1 |
##AtomImplementation |
1603 |
|
|
|
1604 |
|
|
IFClsDef: |
1605 |
|
|
@IFQName: AtomDocument |
1606 |
|
|
@ClsQName: ManakaiAtomDocument |
1607 |
|
|
|
1608 |
wakaba |
1.15 |
@domperl:implementedByObjectsOf: Document |
1609 |
|
|
@domperl:classImplementedByObjectsOf: td|ManakaiDOMDocument |
1610 |
wakaba |
1.1 |
|
1611 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
1612 |
wakaba |
1.1 |
|
1613 |
|
|
@enDesc: |
1614 |
|
|
If the <Feature::fe|Atom> feature version <FeatureVer::1.0> |
1615 |
|
|
is supported, a <IF::Document> object whose <A::Document.documentElement>'s |
1616 |
|
|
<A::Node.namespaceURI>, if any, is <URI^^DISCore|QName::atom|> at least |
1617 |
|
|
at the time of creation <kwd:MUST> also |
1618 |
|
|
implement the <IF::AtomDocument> interface. Other |
1619 |
|
|
<IF:Document> objects <kwd:MAY> also implement |
1620 |
|
|
the <IF::AtomDocument> interface. |
1621 |
|
|
|
1622 |
|
|
@Test: |
1623 |
|
|
@@QName: createDocument.AtomDocument.test |
1624 |
|
|
@@PerlDef: |
1625 |
|
|
my $impl; |
1626 |
|
|
__CODE{tc|createImplForTest:: $impl => $impl}__; |
1627 |
|
|
|
1628 |
|
|
my $doc = $impl-><M::c|DOMImplementation.createDocument> |
1629 |
|
|
(<Q::atom|>, 'unknown'); |
1630 |
|
|
|
1631 |
|
|
$test->id ('interface'); |
1632 |
|
|
$test->assert_isa ($doc, <IFName::AtomDocument>); |
1633 |
|
|
##AtomDocument |
1634 |
|
|
|
1635 |
wakaba |
1.7 |
AGDef: |
1636 |
|
|
@QName: atomCommonAttributes |
1637 |
|
|
@enFN: common attributes |
1638 |
|
|
@mv:attributeTypeGroupName: common |
1639 |
wakaba |
1.13 |
|
1640 |
|
|
@mv:refers: Atom |
1641 |
wakaba |
1.7 |
|
1642 |
|
|
@ATDef: |
1643 |
|
|
@@mv:attributeTypeName: xml|base |
1644 |
|
|
@@mv:attributeValueType: atomUri |
1645 |
|
|
|
1646 |
|
|
@ATDef: |
1647 |
|
|
@@mv:attributeTypeName: xml|lang |
1648 |
|
|
@@mv:attributeValueType: atomLanguageTag |
1649 |
|
|
|
1650 |
wakaba |
1.8 |
@mv:refers: undefinedAttributes |
1651 |
wakaba |
1.7 |
##atomCommonAttributes |
1652 |
|
|
|
1653 |
|
|
STDef: |
1654 |
|
|
@QName: atomNCName |
1655 |
|
|
@mv:datatypeEntityName: NCName |
1656 |
|
|
#subsetOf: xsd|string |
1657 |
|
|
#minLength, pattern |
1658 |
|
|
|
1659 |
|
|
STDef: |
1660 |
|
|
@QName: atomMediaType |
1661 |
|
|
@mv:datatypeEntityName: MediaType |
1662 |
|
|
#subsetOf xsd|string |
1663 |
|
|
# pattern |
1664 |
|
|
|
1665 |
|
|
STDef: |
1666 |
|
|
@QName: atomLanguageTag |
1667 |
|
|
@mv:datatypeEntityName: LangaugeTag |
1668 |
|
|
#subsetOf: xsd|string |
1669 |
|
|
#pattern |
1670 |
|
|
|
1671 |
|
|
STDef: |
1672 |
|
|
@QName: atomUri |
1673 |
|
|
@mv:datatypeEntityName: URI |
1674 |
|
|
#aliasfor text |
1675 |
wakaba |
1.9 |
STCDef: |
1676 |
|
|
@QName: atomUriCM |
1677 |
|
|
@mv:elementContentModelName: URI |
1678 |
|
|
@cm: (dxm|PCDATA||ManakaiDOM|all)* |
1679 |
wakaba |
1.7 |
|
1680 |
|
|
STDef: |
1681 |
|
|
@QName: atomEmailAddress |
1682 |
|
|
@mv:datatypeEntityName: EmailAddress |
1683 |
|
|
#subsetOf xsd|string |
1684 |
|
|
#pattern |
1685 |
wakaba |
1.9 |
STCDef: |
1686 |
|
|
@QName: atomEmailAddressCM |
1687 |
|
|
@mv:elementContentModelName: EmailAddress |
1688 |
|
|
@cm: (dxm|PCDATA||ManakaiDOM|all)* |
1689 |
wakaba |
1.7 |
|
1690 |
|
|
ElementTypeBinding: |
1691 |
|
|
@Name: AGDef |
1692 |
|
|
@ElementType: |
1693 |
|
|
dis:ResourceDef |
1694 |
|
|
@ShadowContent: |
1695 |
|
|
@@DISCore:resourceType: mv|AttributeTypeGroup |
1696 |
|
|
@@For: =ManakaiDOM|ManakaiDOMLatest |
1697 |
|
|
|
1698 |
|
|
ElementTypeBinding: |
1699 |
|
|
@Name: ATDef |
1700 |
|
|
@ElementType: |
1701 |
|
|
dis:ResourceDef |
1702 |
|
|
@ShadowContent: |
1703 |
|
|
@@DISCore:resourceType: mv|AttributeType |
1704 |
|
|
@@For: =ManakaiDOM|ManakaiDOMLatest |
1705 |
|
|
|
1706 |
|
|
ElementTypeBinding: |
1707 |
wakaba |
1.8 |
@Name: ECDef |
1708 |
|
|
@ElementType: |
1709 |
|
|
dis:ResourceDef |
1710 |
|
|
@ShadowContent: |
1711 |
|
|
@@DISCore:resourceType: mv|ElementTypeClass |
1712 |
|
|
@@For: =ManakaiDOM|ManakaiDOMLatest |
1713 |
|
|
|
1714 |
|
|
ElementTypeBinding: |
1715 |
|
|
@Name: EMDef |
1716 |
|
|
@ElementType: |
1717 |
|
|
dis:ResourceDef |
1718 |
|
|
@ShadowContent: |
1719 |
|
|
@@DISCore:resourceType: mv|ElementTypeClassMix |
1720 |
|
|
@@For: =ManakaiDOM|ManakaiDOMLatest |
1721 |
|
|
|
1722 |
|
|
ElementTypeBinding: |
1723 |
wakaba |
1.7 |
@Name: STDef |
1724 |
|
|
@ElementType: |
1725 |
|
|
dis:ResourceDef |
1726 |
|
|
@ShadowContent: |
1727 |
|
|
@@DISCore:resourceType: mv|XMLDTDDatatypeEntity |
1728 |
|
|
@@For: =ManakaiDOM|ManakaiDOMLatest |
1729 |
|
|
|
1730 |
wakaba |
1.9 |
ElementTypeBinding: |
1731 |
|
|
@Name: STCDef |
1732 |
|
|
@ElementType: |
1733 |
|
|
dis:ResourceDef |
1734 |
|
|
@ShadowContent: |
1735 |
|
|
@@DISCore:resourceType: mv|ElementContentModel |
1736 |
|
|
@@For: =ManakaiDOM|ManakaiDOMLatest |
1737 |
|
|
|
1738 |
wakaba |
1.1 |
IFClsDef: |
1739 |
|
|
@IFQName: AtomElement |
1740 |
|
|
@ClsQName: ManakaiAtomElement |
1741 |
|
|
|
1742 |
|
|
@IFISA: Element |
1743 |
|
|
@ClsISA: te|ManakaiDOMElement |
1744 |
|
|
|
1745 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
1746 |
wakaba |
1.1 |
@s:elementType: AnyAtomElement||ManakaiDOM|all |
1747 |
|
|
|
1748 |
|
|
@enDesc: |
1749 |
|
|
The <IF::AtomElement> interface provides convenience |
1750 |
|
|
methods and attributes for Atom elements. |
1751 |
|
|
|
1752 |
|
|
If the <Feature::fe|Atom> feature version <FeatureVer::1.0> |
1753 |
|
|
is supported, an <IF::Element> object whose namespace URI |
1754 |
|
|
is <URI^^DIS|QName::atom|> <kwd:MUST> also implement |
1755 |
|
|
the <IF::AtomElement> interface. Other <IF::Element> objects |
1756 |
|
|
<kwd:MAY> also implement the <IF::AtomElement> interface. |
1757 |
|
|
|
1758 |
|
|
@enImplNote: |
1759 |
|
|
@@ddid: todo |
1760 |
|
|
@@@: |
1761 |
|
|
{TODO:: |
1762 |
|
|
Need <CODE::xmllang> and <CODE::xmlbase> attributes |
1763 |
|
|
from SVG? |
1764 |
|
|
} |
1765 |
|
|
|
1766 |
|
|
@Test: |
1767 |
|
|
@@QName: AtomElement.interface.test |
1768 |
|
|
@@PerlDef: |
1769 |
|
|
for my $interface ( |
1770 |
|
|
<IFName::AtomElement>, |
1771 |
|
|
<IFName::Element>, |
1772 |
|
|
<IFName::Node>, |
1773 |
|
|
<IFName::f|GetFeature>, |
1774 |
|
|
) { |
1775 |
|
|
$test->id ($interface); |
1776 |
|
|
$test->assert_true (<Class::ManakaiAtomElement>->isa ($interface)); |
1777 |
|
|
} |
1778 |
|
|
@Test: |
1779 |
|
|
@@QName: createElementNS.AtomElement.test |
1780 |
|
|
@@PerlDef: |
1781 |
|
|
my $doc; |
1782 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
1783 |
|
|
|
1784 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'unknown'); |
1785 |
|
|
$test->assert_isa ($el, <IFName::AtomElement>); |
1786 |
|
|
##AtomElement |
1787 |
|
|
|
1788 |
|
|
ResourceDef: |
1789 |
|
|
@QName: AnyAtomElement |
1790 |
|
|
@DISCore:resourceType: s|AnyElementInNS |
1791 |
|
|
@AppName: |
1792 |
|
|
@@@: atom|* |
1793 |
|
|
@@ContentType: DISCore|QName |
1794 |
|
|
@ForCheck: =ManakaiDOM|all |
1795 |
|
|
|
1796 |
wakaba |
1.9 |
ElementTypeBinding: |
1797 |
|
|
@Name: cm |
1798 |
|
|
@ElementType: |
1799 |
|
|
mv:elementContentModel |
1800 |
|
|
@ShadowContent: |
1801 |
|
|
@@ContentType: lang|dcmodel |
1802 |
|
|
|
1803 |
wakaba |
1.6 |
IFClsConstructDef: |
1804 |
wakaba |
1.1 |
@IFQName: AtomTextConstruct |
1805 |
|
|
@ClsQName: ManakaiAtomTextConstruct |
1806 |
wakaba |
1.6 |
@AGQName: TextAG |
1807 |
|
|
@AGName: text |
1808 |
|
|
@CMQName: TextCM |
1809 |
|
|
@CMName: text |
1810 |
wakaba |
1.1 |
|
1811 |
|
|
@IFISA: AtomElement |
1812 |
|
|
@ClsISA: ManakaiAtomElement |
1813 |
|
|
|
1814 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
1815 |
wakaba |
1.10 |
@mv:refers: atomCommonAttributes |
1816 |
|
|
|
1817 |
wakaba |
1.9 |
@cm: |
1818 |
|
|
dxm|ANY||ManakaiDOM|all |
1819 |
|
|
@enImplNote: |
1820 |
|
|
@@ddid:cm |
1821 |
|
|
@@@: |
1822 |
|
|
{TODO:: |
1823 |
|
|
(dxm|PCDATA||ManakaiDOM|all | html|div)* |
1824 |
|
|
} |
1825 |
|
|
|
1826 |
wakaba |
1.1 |
@enDesc: |
1827 |
|
|
The <IF::AtomTextConstruct> interface provides convenience |
1828 |
|
|
methods and attributes for <IF::Element> nodes |
1829 |
|
|
classfied to the Text constructs. Other <IF::Element> |
1830 |
|
|
objects <kwd:MAY> also implement the <IF::AtomTextConstruct> |
1831 |
|
|
interface. |
1832 |
|
|
|
1833 |
|
|
A Text construct contains human-readable text, usually in |
1834 |
wakaba |
1.7 |
small quantities. The content of a Text construct is |
1835 |
wakaba |
1.1 |
Language-Sensitive. |
1836 |
|
|
|
1837 |
wakaba |
1.6 |
@ATTR: |
1838 |
wakaba |
1.1 |
@@Name: type |
1839 |
|
|
@@enDesc: |
1840 |
|
|
The <XA::type> attribute of the element. |
1841 |
|
|
|
1842 |
|
|
It <kwd:MUST> <I::reflect the string value |
1843 |
|
|
of the <XA::type> attribute> of the node. The |
1844 |
|
|
default value <kwd:MUST> be <CODE::text>. |
1845 |
|
|
@@Type: DOMString |
1846 |
|
|
@@Get: |
1847 |
|
|
@@@nullCase: |
1848 |
|
|
@@@@enDesc: |
1849 |
|
|
If the algorithm returns <DOM::null>. |
1850 |
|
|
@@@PerlDef: |
1851 |
|
|
__CODE{getReflectAttrStringValue:: |
1852 |
|
|
$node => $self, |
1853 |
|
|
$namespaceURI => {null}, |
1854 |
|
|
$localName => 'type', |
1855 |
|
|
$r => $r, |
1856 |
|
|
$defaultValue => 'text', |
1857 |
|
|
}__; |
1858 |
|
|
@@Set: |
1859 |
|
|
@@@nullCase: |
1860 |
|
|
@@@@enDesc: |
1861 |
|
|
Removes the attribute. |
1862 |
|
|
@@@NodeReadOnlyError: |
1863 |
|
|
@@@PerlDef: |
1864 |
|
|
__CODE{setReflectAttrStringValue:: |
1865 |
|
|
$node => $self, |
1866 |
|
|
$namespaceURI => {null}, |
1867 |
|
|
$localName => 'type', |
1868 |
|
|
$given => $given, |
1869 |
|
|
}__; |
1870 |
|
|
|
1871 |
|
|
@Attr: |
1872 |
|
|
@@Name: container |
1873 |
|
|
@@enDesc: |
1874 |
|
|
The container element that contains the actual content |
1875 |
|
|
of the construct. |
1876 |
|
|
@@Type: Element |
1877 |
|
|
@@Get: |
1878 |
|
|
@@@enDesc: |
1879 |
|
|
If the <A::AtomTextConstruct.type> is <CODE::xhtml>, |
1880 |
|
|
the getter <kwd:MUST> <I::return the <XE::html|div> child element>. |
1881 |
|
|
Otherwise, the object itself <kwd:MUST> be returned. |
1882 |
|
|
@@@nullCase: |
1883 |
|
|
@@@@enDesc: |
1884 |
|
|
If the <A::AtomTextConstruct.type> is <CODE::xhtml> |
1885 |
|
|
and the algorithm returns <DOM::null>. |
1886 |
|
|
@@@NodeReadOnlyError: |
1887 |
|
|
@@@PerlDef: |
1888 |
|
|
__DEEP{ |
1889 |
|
|
my $type = $self-><AG::AtomTextConstruct.type>; |
1890 |
|
|
if ($type eq 'xhtml') { |
1891 |
|
|
__CODE{returnChildElement:: |
1892 |
|
|
$node => $self, |
1893 |
|
|
$namespaceURI => {<Q::html|>}, |
1894 |
|
|
$localName => 'div', |
1895 |
|
|
$r => $r, |
1896 |
|
|
}__; |
1897 |
|
|
} else { |
1898 |
|
|
$r = $self; |
1899 |
|
|
} |
1900 |
|
|
}__; |
1901 |
|
|
|
1902 |
|
|
@@Test: |
1903 |
|
|
@@@QName: AtomTextConstruct.container.test |
1904 |
|
|
@@@PerlDef: |
1905 |
|
|
my $doc; |
1906 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
1907 |
|
|
|
1908 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'title'); |
1909 |
|
|
|
1910 |
|
|
$test->id ('no'); |
1911 |
|
|
$test->assert_equals ($el-><AG::AtomTextConstruct.container>, $el); |
1912 |
|
|
|
1913 |
|
|
$test->id ('text'); |
1914 |
|
|
$el-><AS::AtomTextConstruct.type> ('text'); |
1915 |
|
|
$test->assert_equals ($el-><AG::AtomTextConstruct.container>, $el); |
1916 |
|
|
|
1917 |
|
|
$test->id ('html'); |
1918 |
|
|
$el-><AS::AtomTextConstruct.type> ('html'); |
1919 |
|
|
$test->assert_equals ($el-><AG::AtomTextConstruct.container>, $el); |
1920 |
|
|
|
1921 |
|
|
$test->id ('xhtml'); |
1922 |
|
|
$el-><AS::AtomTextConstruct.type> ('xhtml'); |
1923 |
|
|
$test->assert_null ($el-><AG::AtomTextConstruct.container>); |
1924 |
|
|
|
1925 |
|
|
$doc-><AG::Document.domConfig> |
1926 |
|
|
-><M::CFG.setParameter> (<Q::cfg|create-child-element> => true); |
1927 |
|
|
my $con = $el-><AG::AtomTextConstruct.container>; |
1928 |
|
|
|
1929 |
|
|
$test->id ('xhtml.create'); |
1930 |
|
|
$test->assert_not_equals ($con, $el); |
1931 |
|
|
|
1932 |
|
|
$test->id ('xhtml.namespaceURI'); |
1933 |
|
|
$test->assert_equals ($con-><AG::Node.namespaceURI>, <Q::html|>); |
1934 |
|
|
|
1935 |
|
|
$test->id ('xhtml.localName'); |
1936 |
|
|
$test->assert_equals ($con-><AG::Node.localName>, 'div'); |
1937 |
|
|
|
1938 |
|
|
$test->id ('xhtml.parentNode'); |
1939 |
|
|
$test->assert_equals ($con-><AG::Node.parentNode>, $el); |
1940 |
|
|
|
1941 |
|
|
$test->id ('xhtml.2'); |
1942 |
|
|
$test->assert_equals ($el-><AG::AtomTextConstruct.container>, $con); |
1943 |
|
|
##AtomTextConstruct |
1944 |
|
|
|
1945 |
wakaba |
1.6 |
IFClsConstructDef: |
1946 |
wakaba |
1.1 |
@IFQName: AtomPersonConstruct |
1947 |
|
|
@ClsQName: ManakaiAtomPersonConstruct |
1948 |
wakaba |
1.6 |
@AGQName: PersonAG |
1949 |
|
|
@AGName: person |
1950 |
|
|
@CMQName: PersonCM |
1951 |
|
|
@CMName: person |
1952 |
wakaba |
1.1 |
|
1953 |
|
|
@IFISA: AtomElement |
1954 |
|
|
@ClsISA: ManakaiAtomElement |
1955 |
|
|
|
1956 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
1957 |
wakaba |
1.10 |
@mv:refers: atomCommonAttributes |
1958 |
|
|
|
1959 |
wakaba |
1.9 |
@cm: |
1960 |
|
|
(person-prop+) |
1961 |
|
|
|
1962 |
wakaba |
1.1 |
@enDesc: |
1963 |
|
|
The <IF::AtomPersonConstruct> interface provides convenience |
1964 |
|
|
methods and attributes for <IF::Element> nodes |
1965 |
|
|
classfied to the Person constructs. Other <IF::Element> |
1966 |
|
|
objects <kwd:MAY> also implement the <IF::AtomPersonConstruct> |
1967 |
|
|
interface. |
1968 |
|
|
|
1969 |
|
|
A Person construct is an element that describes a person, |
1970 |
|
|
corporation, or similar entity. |
1971 |
|
|
|
1972 |
|
|
@Attr: |
1973 |
|
|
@@Name: name |
1974 |
|
|
@@enDesc: |
1975 |
|
|
The <XE::atom|name> value of the feed. |
1976 |
|
|
|
1977 |
|
|
It <kwd:MUST> <I::reflect the string value |
1978 |
|
|
of the <XE::atom|name> child element> of the node. |
1979 |
|
|
@@Type: DOMString |
1980 |
|
|
@@Get: |
1981 |
|
|
@@@nullCase: |
1982 |
|
|
@@@@enDesc: |
1983 |
|
|
If the algorithm returns <DOM::null>. |
1984 |
|
|
@@@NodeReadOnlyError: |
1985 |
|
|
@@@PerlDef: |
1986 |
|
|
__CODE{getReflectStringValue:: |
1987 |
|
|
$node => $self, |
1988 |
|
|
$namespaceURI => {<Q::atom|>}, |
1989 |
|
|
$localName => 'name', |
1990 |
|
|
$r => $r, |
1991 |
|
|
}__; |
1992 |
|
|
@@Set: |
1993 |
|
|
@@@nullCase: |
1994 |
|
|
@@@@enDesc: |
1995 |
|
|
Removes the value. |
1996 |
|
|
@@@NodeReadOnlyError: |
1997 |
|
|
@@@PerlDef: |
1998 |
|
|
__CODE{setReflectStringValue:: |
1999 |
|
|
$node => $self, |
2000 |
|
|
$namespaceURI => {<Q::atom|>}, |
2001 |
|
|
$localName => 'name', |
2002 |
|
|
$given => $given, |
2003 |
|
|
}__; |
2004 |
|
|
|
2005 |
|
|
@Attr: |
2006 |
|
|
@@Name: nameElement |
2007 |
|
|
@@enDesc: |
2008 |
|
|
The <XE::atom|name> child element of the node. |
2009 |
wakaba |
1.7 |
@@Type: AtomNameElement |
2010 |
wakaba |
1.1 |
@@Get: |
2011 |
|
|
@@@enDesc: |
2012 |
|
|
It <kwd:MUST> <I::return a <XE::atom|name> child element> |
2013 |
|
|
of the node. |
2014 |
|
|
@@@nullCase: |
2015 |
|
|
@@@@enDesc: |
2016 |
|
|
If the algorithm returns <DOM::null>. |
2017 |
|
|
@@@NodeReadOnlyError: |
2018 |
|
|
@@@PerlDef: |
2019 |
|
|
__CODE{returnChildElement:: |
2020 |
|
|
$node => $self, |
2021 |
|
|
$namespaceURI => {<Q::atom|>}, |
2022 |
|
|
$localName => 'name', |
2023 |
|
|
$r => $r, |
2024 |
|
|
}__; |
2025 |
|
|
|
2026 |
|
|
@Attr: |
2027 |
|
|
@@Name: uri |
2028 |
|
|
@@enDesc: |
2029 |
|
|
The <XE::atom|uri> value of the feed. |
2030 |
|
|
|
2031 |
|
|
It <kwd:MUST> <I::reflect the URI value |
2032 |
|
|
of the <XE::atom|uri> child element> of the node. |
2033 |
|
|
@@Type: DOMString |
2034 |
|
|
@@actualType: DOMURI |
2035 |
|
|
@@Get: |
2036 |
|
|
@@@nullCase: |
2037 |
|
|
@@@@enDesc: |
2038 |
|
|
If the algorithm returns <DOM::null>. |
2039 |
|
|
@@@NodeReadOnlyError: |
2040 |
|
|
@@@PerlDef: |
2041 |
|
|
__CODE{getReflectURIValue:: |
2042 |
|
|
$node => $self, |
2043 |
|
|
$namespaceURI => {<Q::atom|>}, |
2044 |
|
|
$localName => 'uri', |
2045 |
|
|
$r => $r, |
2046 |
|
|
}__; |
2047 |
|
|
@@Set: |
2048 |
|
|
@@@nullCase: |
2049 |
|
|
@@@@enDesc: |
2050 |
|
|
Removes the value. |
2051 |
|
|
@@@NodeReadOnlyError: |
2052 |
|
|
@@@PerlDef: |
2053 |
|
|
__CODE{setReflectURIValue:: |
2054 |
|
|
$node => $self, |
2055 |
|
|
$namespaceURI => {<Q::atom|>}, |
2056 |
|
|
$localName => 'uri', |
2057 |
|
|
$given => $given, |
2058 |
|
|
}__; |
2059 |
|
|
|
2060 |
|
|
@Attr: |
2061 |
|
|
@@Name: email |
2062 |
|
|
@@enDesc: |
2063 |
|
|
The <XE::atom|email> value of the feed. |
2064 |
|
|
|
2065 |
|
|
It <kwd:MUST> <I::reflect the string value |
2066 |
|
|
of the <XE::atom|email> child element> of the node. |
2067 |
|
|
@@Type: DOMString |
2068 |
|
|
@@Get: |
2069 |
|
|
@@@nullCase: |
2070 |
|
|
@@@@enDesc: |
2071 |
|
|
If the algorithm returns <DOM::null>. |
2072 |
|
|
@@@NodeReadOnlyError: |
2073 |
|
|
@@@PerlDef: |
2074 |
|
|
__CODE{getReflectStringValue:: |
2075 |
|
|
$node => $self, |
2076 |
|
|
$namespaceURI => {<Q::atom|>}, |
2077 |
|
|
$localName => 'email', |
2078 |
|
|
$r => $r, |
2079 |
|
|
}__; |
2080 |
|
|
@@Set: |
2081 |
|
|
@@@nullCase: |
2082 |
|
|
@@@@enDesc: |
2083 |
|
|
Removes the value. |
2084 |
|
|
@@@NodeReadOnlyError: |
2085 |
|
|
@@@PerlDef: |
2086 |
|
|
__CODE{setReflectStringValue:: |
2087 |
|
|
$node => $self, |
2088 |
|
|
$namespaceURI => {<Q::atom|>}, |
2089 |
|
|
$localName => 'email', |
2090 |
|
|
$given => $given, |
2091 |
|
|
}__; |
2092 |
|
|
##AtomPersonConstruct |
2093 |
|
|
|
2094 |
wakaba |
1.8 |
ECDef: |
2095 |
|
|
@QName: person-prop |
2096 |
|
|
@mv:elementTypeClassName: person-prop |
2097 |
|
|
@mv:refers: atom|name |
2098 |
|
|
@mv:refers: atom|uri |
2099 |
|
|
@mv:refers: atom|email |
2100 |
|
|
@mv:refers: extensionElements |
2101 |
|
|
|
2102 |
wakaba |
1.6 |
IFClsConstructDef: |
2103 |
wakaba |
1.1 |
@IFQName: AtomDateConstruct |
2104 |
|
|
@ClsQName: ManakaiAtomDateConstruct |
2105 |
wakaba |
1.6 |
@AGQName: DateAG |
2106 |
|
|
@AGName: date |
2107 |
|
|
@CMQName: DateCM |
2108 |
|
|
@CMName: date |
2109 |
wakaba |
1.1 |
|
2110 |
|
|
@IFISA: AtomElement |
2111 |
|
|
@ClsISA: ManakaiAtomElement |
2112 |
|
|
|
2113 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
2114 |
wakaba |
1.10 |
@mv:refers: atomCommonAttributes |
2115 |
|
|
|
2116 |
wakaba |
1.9 |
@cm: |
2117 |
|
|
(dxm|PCDATA||ManakaiDOM|all)* |
2118 |
|
|
@enImplNote: |
2119 |
|
|
@@ddid: cm |
2120 |
|
|
@@@: |
2121 |
|
|
{TODO:: |
2122 |
|
|
xsd|dateTime |
2123 |
|
|
} |
2124 |
|
|
|
2125 |
wakaba |
1.1 |
@enDesc: |
2126 |
|
|
The <IF::AtomDateConstruct> interface provides convenience |
2127 |
|
|
methods and attributes for <IF::Element> nodes |
2128 |
|
|
classfied to the Date constructs. Other <IF::Element> |
2129 |
|
|
objects <kwd:MAY> also implement the <IF::AtomDateConstruct> |
2130 |
|
|
interface. |
2131 |
|
|
|
2132 |
|
|
A Date construct is an element whose content is a date that |
2133 |
|
|
conforms to the uppercase version of the RFC 3339 format. |
2134 |
|
|
|
2135 |
|
|
@Attr: |
2136 |
|
|
@@Name: value |
2137 |
|
|
@@enDesc: |
2138 |
|
|
The date value of the node. |
2139 |
|
|
|
2140 |
|
|
{ISSUE:: |
2141 |
|
|
|
2142 |
|
|
- Out of range of platform DOMTimeStamp type |
2143 |
|
|
|
2144 |
|
|
- Errorous xsd:dateTime |
2145 |
|
|
|
2146 |
|
|
- Leap seconds |
2147 |
|
|
|
2148 |
|
|
- Timezone |
2149 |
|
|
|
2150 |
|
|
- Precision |
2151 |
|
|
|
2152 |
|
|
} |
2153 |
|
|
@@Type: DOMTimeStamp |
2154 |
|
|
@@Get: |
2155 |
|
|
@@@enDesc: |
2156 |
|
|
{TODO:: Define |
2157 |
|
|
} |
2158 |
|
|
@@@PerlDef: |
2159 |
|
|
my $value = $self-><AG::Node.textContent>; |
2160 |
|
|
if ($value =~ /\A(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)(\.\d+)? |
2161 |
|
|
(?:Z|([+-]\d+):(\d+))\z/x) { |
2162 |
|
|
require Time::Local; |
2163 |
|
|
$r = Time::Local::timegm_nocheck |
2164 |
|
|
($6, defined $8 ? $8 > 0 ? $5 - $9 : $5 + $9 : $5, |
2165 |
|
|
defined $8 ? $4 - $8 : $4, $3, $2-1, $1-1900); |
2166 |
|
|
$r += "0$7" if defined $7; |
2167 |
|
|
} else { |
2168 |
|
|
$r = 0; |
2169 |
|
|
} |
2170 |
|
|
@@Set: |
2171 |
|
|
@@@enDesc: |
2172 |
|
|
{TODO:: Define |
2173 |
|
|
} |
2174 |
|
|
@@@NodeReadOnlyError: |
2175 |
|
|
@@@PerlDef: |
2176 |
|
|
__DEEP{ |
2177 |
|
|
my @value = gmtime (int ($given / 1)); |
2178 |
|
|
my $value = sprintf '%04d-%02d-%02dT%02d:%02d:%02d', |
2179 |
|
|
$value[5] + 1900, $value[4] + 1, |
2180 |
|
|
$value[3], $value[2], $value[1], $value[0]; |
2181 |
|
|
my $f = $given % 1; |
2182 |
|
|
$value .= substr (''.$f, 1) if $f; |
2183 |
|
|
$value .= 'Z'; |
2184 |
|
|
$self-><AS::Node.textContent> ($value); |
2185 |
|
|
}__; |
2186 |
|
|
|
2187 |
|
|
@enImplNote: |
2188 |
|
|
@@ddid: todo |
2189 |
|
|
@@@: |
2190 |
|
|
{TODO:: |
2191 |
|
|
Access to components, especially timezone and -00:00. |
2192 |
|
|
} |
2193 |
|
|
##AtomDateConstruct |
2194 |
|
|
|
2195 |
wakaba |
1.8 |
ECDef: |
2196 |
|
|
@QName: feed-prop |
2197 |
|
|
@mv:elementTypeClassName: feed-prop |
2198 |
|
|
@mv:refers: atom|author |
2199 |
|
|
@mv:refers: atom|category |
2200 |
|
|
@mv:refers: atom|contributor |
2201 |
|
|
@mv:refers: atom|generator |
2202 |
|
|
@mv:refers: atom|icon |
2203 |
|
|
@mv:refers: atom|id |
2204 |
|
|
@mv:refers: atom|link |
2205 |
|
|
@mv:refers: atom|logo |
2206 |
|
|
@mv:refers: atom|rights |
2207 |
|
|
@mv:refers: atom|subtitle |
2208 |
|
|
@mv:refers: atom|title |
2209 |
|
|
@mv:refers: atom|updated |
2210 |
|
|
@mv:refers: extensionElements |
2211 |
|
|
|
2212 |
wakaba |
1.1 |
IFClsETDef: |
2213 |
|
|
@IFQName: AtomFeedElement |
2214 |
|
|
@ETQName: atom|feed |
2215 |
|
|
@ETRQName: atom|feed |
2216 |
|
|
@ClsQName: ManakaiAtomFeedElement |
2217 |
|
|
|
2218 |
|
|
@IFISA: AtomElement |
2219 |
|
|
@ClsISA: ManakaiAtomElement |
2220 |
|
|
|
2221 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
2222 |
wakaba |
1.10 |
@mv:refers: atomCommonAttributes |
2223 |
|
|
|
2224 |
wakaba |
1.9 |
@cm: |
2225 |
|
|
(feed-prop+, atom|entry*) |
2226 |
|
|
|
2227 |
wakaba |
1.1 |
@enDesc: |
2228 |
|
|
The <XE::atom|feed> element is the document element |
2229 |
|
|
of an Atom Feed Document. |
2230 |
wakaba |
1.3 |
|
2231 |
|
|
{ISSUE:: |
2232 |
|
|
<XE::atom|entry> children <kwd:MUST> be placed after |
2233 |
|
|
any other elements. Attributes creating children |
2234 |
|
|
should insert them before any entries? |
2235 |
|
|
} |
2236 |
wakaba |
1.1 |
|
2237 |
|
|
@Attr: |
2238 |
|
|
@@Name: authorElements |
2239 |
|
|
@@enDesc: |
2240 |
|
|
A static list of <XE::atom|author> child elements of the node. |
2241 |
|
|
@@Type: StaticNodeList |
2242 |
|
|
@@Get: |
2243 |
|
|
@@@enDesc: |
2244 |
|
|
It <kwd:MUST> <I::return a <XE::atom|author> child element list> |
2245 |
|
|
of the node. |
2246 |
|
|
@@@PerlDef: |
2247 |
|
|
__CODE{returnChildElementList:: |
2248 |
|
|
$node => $self, |
2249 |
|
|
$namespaceURI => {<Q::atom|>}, |
2250 |
|
|
$localName => 'author', |
2251 |
|
|
$r => $r, |
2252 |
|
|
}__; |
2253 |
|
|
|
2254 |
|
|
@@Test: |
2255 |
|
|
@@@QName: AtomFeedElement.authorElements.empty.test |
2256 |
|
|
@@@PerlDef: |
2257 |
|
|
my $doc; |
2258 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
2259 |
|
|
|
2260 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed'); |
2261 |
|
|
|
2262 |
|
|
my $list = $el-><AG::AtomFeedElement.authorElements>; |
2263 |
|
|
|
2264 |
|
|
$test->id ('interface'); |
2265 |
|
|
$test->assert_isa ($list, <IFName::StaticNodeList>); |
2266 |
|
|
|
2267 |
|
|
$test->id ('length'); |
2268 |
|
|
$test->assert_num_equals |
2269 |
|
|
(actual_value => 0+@{$list}, expected_value => 0); |
2270 |
|
|
|
2271 |
|
|
$test->id ('readOnly'); |
2272 |
|
|
$test->assert_false ($list-><AG::NodeList.manakaiReadOnly>); |
2273 |
|
|
@@Test: |
2274 |
|
|
@@@QName: AtomFeedElement.authorElements.two.test |
2275 |
|
|
@@@PerlDef: |
2276 |
|
|
my $doc; |
2277 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
2278 |
|
|
|
2279 |
|
|
my $e1 = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed'); |
2280 |
|
|
my $a1 = $doc-><M::Document.createElementNS> (<Q::atom|>, 'author'); |
2281 |
|
|
$e1-><M::Node.appendChild> ($a1); |
2282 |
|
|
my $a2 = $doc-><M::Document.createElementNS> (<Q::atom|>, 'author'); |
2283 |
|
|
$e1-><M::Node.appendChild> ($a2); |
2284 |
|
|
|
2285 |
|
|
my $list = $e1-><AG::AtomFeedElement.authorElements>; |
2286 |
|
|
my $a3 = $doc-><M::Document.createElementNS> (<Q::atom|>, 'author'); |
2287 |
|
|
$e1-><M::Node.appendChild> ($a3); |
2288 |
|
|
|
2289 |
|
|
$test->id ('length'); |
2290 |
|
|
$test->assert_num_equals |
2291 |
|
|
(actual_value => 0+@{$list}, expected_value => 2); |
2292 |
|
|
|
2293 |
|
|
$test->id (0); |
2294 |
|
|
$test->assert_equals ($list->[0], $a1); |
2295 |
|
|
|
2296 |
|
|
$test->id (1); |
2297 |
|
|
$test->assert_equals ($list->[1], $a2); |
2298 |
|
|
|
2299 |
|
|
@Attr: |
2300 |
|
|
@@Name: categoryElements |
2301 |
|
|
@@enDesc: |
2302 |
|
|
A static list of <XE::atom|category> child elements of the node. |
2303 |
|
|
@@Type: StaticNodeList |
2304 |
|
|
@@Get: |
2305 |
|
|
@@@enDesc: |
2306 |
|
|
It <kwd:MUST> <I::return a <XE::atom|category> child element list> |
2307 |
|
|
of the node. |
2308 |
|
|
@@@PerlDef: |
2309 |
|
|
__CODE{returnChildElementList:: |
2310 |
|
|
$node => $self, |
2311 |
|
|
$namespaceURI => {<Q::atom|>}, |
2312 |
|
|
$localName => 'category', |
2313 |
|
|
$r => $r, |
2314 |
|
|
}__; |
2315 |
|
|
|
2316 |
|
|
@Attr: |
2317 |
|
|
@@Name: contributorElements |
2318 |
|
|
@@enDesc: |
2319 |
|
|
A static list of <XE::atom|contributor> child elements of the node. |
2320 |
|
|
@@Type: StaticNodeList |
2321 |
|
|
@@Get: |
2322 |
|
|
@@@enDesc: |
2323 |
|
|
It <kwd:MUST> <I::return a <XE::atom|contributor> child element list> |
2324 |
|
|
of the node. |
2325 |
|
|
@@@PerlDef: |
2326 |
|
|
__CODE{returnChildElementList:: |
2327 |
|
|
$node => $self, |
2328 |
|
|
$namespaceURI => {<Q::atom|>}, |
2329 |
|
|
$localName => 'contributor', |
2330 |
|
|
$r => $r, |
2331 |
|
|
}__; |
2332 |
|
|
|
2333 |
|
|
@Attr: |
2334 |
|
|
@@Name: generatorElement |
2335 |
|
|
@@enDesc: |
2336 |
|
|
The <XE::atom|generator> child element of the node. |
2337 |
|
|
@@Type: AtomGeneratorElement |
2338 |
|
|
@@Get: |
2339 |
|
|
@@@enDesc: |
2340 |
|
|
It <kwd:MUST> <I::return a <XE::atom|generator> child element> |
2341 |
|
|
of the node. |
2342 |
|
|
@@@nullCase: |
2343 |
|
|
@@@@enDesc: |
2344 |
|
|
If the algorithm returns <DOM::null>. |
2345 |
|
|
@@@NodeReadOnlyError: |
2346 |
|
|
@@@PerlDef: |
2347 |
|
|
__CODE{returnChildElement:: |
2348 |
|
|
$node => $self, |
2349 |
|
|
$namespaceURI => {<Q::atom|>}, |
2350 |
|
|
$localName => 'generator', |
2351 |
|
|
$r => $r, |
2352 |
|
|
}__; |
2353 |
|
|
|
2354 |
|
|
@@Test: |
2355 |
|
|
@@@QName: AtomFeedElement.generatorElement.test |
2356 |
|
|
@@@PerlDef: |
2357 |
|
|
my $doc; |
2358 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
2359 |
|
|
|
2360 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed'); |
2361 |
|
|
|
2362 |
|
|
$test->id ('no'); |
2363 |
|
|
$test->assert_null ($el-><AG::AtomFeedElement.generatorElement>); |
2364 |
|
|
|
2365 |
|
|
$doc-><AG::Document.domConfig> |
2366 |
|
|
-><M::CFG.setParameter> (<Q::cfg|create-child-element> => true); |
2367 |
|
|
my $ge = $el-><AG::AtomFeedElement.generatorElement>; |
2368 |
|
|
|
2369 |
|
|
$test->id ('create.interface'); |
2370 |
|
|
$test->assert_isa ($ge, <IFName::Element>); |
2371 |
|
|
|
2372 |
|
|
$test->id ('create.namespaceURI'); |
2373 |
|
|
$test->assert_equals ($ge-><AG::Node.namespaceURI>, <Q::atom|>); |
2374 |
|
|
|
2375 |
|
|
$test->id ('create.localName'); |
2376 |
|
|
$test->assert_equals ($ge-><AG::Node.localName>, 'generator'); |
2377 |
|
|
|
2378 |
|
|
$test->id ('has'); |
2379 |
|
|
my $ge2 = $el-><AG::AtomFeedElement.generatorElement>; |
2380 |
|
|
$test->assert_equals ($ge2, $ge); |
2381 |
|
|
|
2382 |
|
|
$test->id ('multiple'); |
2383 |
|
|
$el-><M::Node.appendChild> |
2384 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'generator')); |
2385 |
|
|
my $ge3 = $el-><AG::AtomFeedElement.generatorElement>; |
2386 |
|
|
$test->assert_equals ($ge3, $ge); |
2387 |
|
|
|
2388 |
|
|
@Attr: |
2389 |
|
|
@@Name: icon |
2390 |
|
|
@@enDesc: |
2391 |
|
|
The <XE::atom|icon> value of the feed. |
2392 |
|
|
|
2393 |
|
|
It <kwd:MUST> <I::reflect the URI value |
2394 |
|
|
of the <XE::atom|icon> child element> of the node. |
2395 |
|
|
@@Type: DOMString |
2396 |
|
|
@@actualType: DOMURI |
2397 |
|
|
@@Get: |
2398 |
|
|
@@@nullCase: |
2399 |
|
|
@@@@enDesc: |
2400 |
|
|
If the algorithm returns <DOM::null>. |
2401 |
|
|
@@@NodeReadOnlyError: |
2402 |
|
|
@@@PerlDef: |
2403 |
|
|
__CODE{getReflectURIValue:: |
2404 |
|
|
$node => $self, |
2405 |
|
|
$namespaceURI => {<Q::atom|>}, |
2406 |
|
|
$localName => 'icon', |
2407 |
|
|
$r => $r, |
2408 |
|
|
}__; |
2409 |
|
|
@@Set: |
2410 |
|
|
@@@nullCase: |
2411 |
|
|
@@@@enDesc: |
2412 |
|
|
Removes the value. |
2413 |
|
|
@@@NodeReadOnlyError: |
2414 |
|
|
@@@PerlDef: |
2415 |
|
|
__CODE{setReflectURIValue:: |
2416 |
|
|
$node => $self, |
2417 |
|
|
$namespaceURI => {<Q::atom|>}, |
2418 |
|
|
$localName => 'icon', |
2419 |
|
|
$given => $given, |
2420 |
|
|
}__; |
2421 |
|
|
|
2422 |
|
|
@@Test: |
2423 |
|
|
@@@QName: AtomFeedElement.icon.test |
2424 |
|
|
@@@PerlDef: |
2425 |
|
|
my $doc; |
2426 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
2427 |
|
|
|
2428 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed'); |
2429 |
|
|
|
2430 |
|
|
$test->id ('default'); |
2431 |
|
|
$test->assert_null ($el-><AG::AtomFeedElement.icon>); |
2432 |
|
|
|
2433 |
|
|
$test->id ('set'); |
2434 |
|
|
$el-><AS::AtomFeedElement.icon> ('http://example.com/'); |
2435 |
|
|
$test->assert_equals ($el-><AG::AtomFeedElement.icon>, |
2436 |
|
|
'http://example.com/'); |
2437 |
|
|
|
2438 |
|
|
$test->id ('relative'); |
2439 |
|
|
$el-><AS::AtomFeedElement.icon> ('favicon.ico'); |
2440 |
|
|
$test->assert_equals ($el-><AG::AtomFeedElement.icon>, |
2441 |
|
|
'favicon.ico'); |
2442 |
|
|
|
2443 |
|
|
$test->id ('relative.base'); |
2444 |
|
|
$el-><M::Element.setAttributeNS> (<Q::xml:>, 'xml:base', |
2445 |
|
|
'http://www.example.com/'); |
2446 |
|
|
$test->assert_equals ($el-><AG::AtomFeedElement.icon>, |
2447 |
|
|
'http://www.example.com/favicon.ico'); |
2448 |
|
|
|
2449 |
|
|
$test->id ('multiple'); |
2450 |
|
|
$el-><M::Node.appendChild> |
2451 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'icon')) |
2452 |
|
|
-><AS::Node.textContent> ('/default.ico'); # ignored |
2453 |
|
|
$test->assert_equals ($el-><AG::AtomFeedElement.icon>, |
2454 |
|
|
'http://www.example.com/favicon.ico'); |
2455 |
|
|
|
2456 |
|
|
$test->id ('remove'); |
2457 |
|
|
$el-><AS::AtomFeedElement.icon> (null); |
2458 |
|
|
$test->assert_null ($el-><AG::AtomFeedElement.icon>); |
2459 |
|
|
|
2460 |
|
|
@Attr: |
2461 |
|
|
@@Name: id |
2462 |
|
|
@@enDesc: |
2463 |
|
|
The <XE::atom|id> value of the feed. |
2464 |
|
|
|
2465 |
|
|
It <kwd:MUST> <I::reflect the string value |
2466 |
|
|
of the <XE::atom|id> child element> of the node. |
2467 |
|
|
@@Type: DOMString |
2468 |
|
|
@@actualType: DOMURI |
2469 |
|
|
@@Get: |
2470 |
|
|
@@@nullCase: |
2471 |
|
|
@@@@enDesc: |
2472 |
|
|
If the algorithm returns <DOM::null>. |
2473 |
|
|
@@@NodeReadOnlyError: |
2474 |
|
|
@@@PerlDef: |
2475 |
|
|
__CODE{getReflectStringValue:: |
2476 |
|
|
$node => $self, |
2477 |
|
|
$namespaceURI => {<Q::atom|>}, |
2478 |
|
|
$localName => 'id', |
2479 |
|
|
$r => $r, |
2480 |
|
|
}__; |
2481 |
|
|
@@Set: |
2482 |
|
|
@@@nullCase: |
2483 |
|
|
@@@@enDesc: |
2484 |
|
|
Removes the value. |
2485 |
|
|
@@@NodeReadOnlyError: |
2486 |
|
|
@@@PerlDef: |
2487 |
|
|
__CODE{setReflectStringValue:: |
2488 |
|
|
$node => $self, |
2489 |
|
|
$namespaceURI => {<Q::atom|>}, |
2490 |
|
|
$localName => 'id', |
2491 |
|
|
$given => $given, |
2492 |
|
|
}__; |
2493 |
|
|
|
2494 |
|
|
@@Test: |
2495 |
|
|
@@@QName: AtomFeedElement.id.test |
2496 |
|
|
@@@PerlDef: |
2497 |
|
|
my $doc; |
2498 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
2499 |
|
|
|
2500 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed'); |
2501 |
|
|
|
2502 |
|
|
$test->id ('default'); |
2503 |
|
|
$test->assert_null ($el-><AG::AtomFeedElement.id>); |
2504 |
|
|
|
2505 |
|
|
$test->id ('set'); |
2506 |
|
|
$el-><AS::AtomFeedElement.id> ('http://example.com/'); |
2507 |
|
|
$test->assert_equals ($el-><AG::AtomFeedElement.id>, |
2508 |
|
|
'http://example.com/'); |
2509 |
|
|
|
2510 |
|
|
$test->id ('relative'); |
2511 |
|
|
$el-><AS::AtomFeedElement.id> ('favicon.ico'); |
2512 |
|
|
$test->assert_equals ($el-><AG::AtomFeedElement.id>, |
2513 |
|
|
'favicon.ico'); |
2514 |
|
|
|
2515 |
|
|
$test->id ('relative.base'); |
2516 |
|
|
$el-><M::Element.setAttributeNS> (<Q::xml:>, 'xml:base', |
2517 |
|
|
'http://www.example.com/'); |
2518 |
|
|
$test->assert_equals ($el-><AG::AtomFeedElement.id>, |
2519 |
|
|
'favicon.ico'); |
2520 |
|
|
|
2521 |
|
|
$test->id ('multiple'); |
2522 |
|
|
$el-><M::Node.appendChild> |
2523 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'id')) |
2524 |
|
|
-><AS::Node.textContent> ('/default.ico'); # ignored |
2525 |
|
|
$test->assert_equals ($el-><AG::AtomFeedElement.id>, |
2526 |
|
|
'favicon.ico'); |
2527 |
|
|
|
2528 |
|
|
$test->id ('remove'); |
2529 |
|
|
$el-><AS::AtomFeedElement.id> (null); |
2530 |
|
|
$test->assert_null ($el-><AG::AtomFeedElement.id>); |
2531 |
|
|
|
2532 |
|
|
@Attr: |
2533 |
|
|
@@Name: linkElements |
2534 |
|
|
@@enDesc: |
2535 |
|
|
A static list of <XE::atom|link> child elements of the node. |
2536 |
|
|
@@Type: StaticNodeList |
2537 |
|
|
@@Get: |
2538 |
|
|
@@@enDesc: |
2539 |
|
|
It <kwd:MUST> <I::return a <XE::atom|link> child element list> |
2540 |
|
|
of the node. |
2541 |
|
|
@@@PerlDef: |
2542 |
|
|
__CODE{returnChildElementList:: |
2543 |
|
|
$node => $self, |
2544 |
|
|
$namespaceURI => {<Q::atom|>}, |
2545 |
|
|
$localName => 'link', |
2546 |
|
|
$r => $r, |
2547 |
|
|
}__; |
2548 |
|
|
|
2549 |
|
|
@Attr: |
2550 |
|
|
@@Name: logo |
2551 |
|
|
@@enDesc: |
2552 |
|
|
The <XE::atom|logo> value of the feed. |
2553 |
|
|
|
2554 |
|
|
It <kwd:MUST> <I::reflect the URI value |
2555 |
|
|
of the <XE::atom|logo> child element> of the node. |
2556 |
|
|
@@Type: DOMString |
2557 |
|
|
@@actualType: DOMURI |
2558 |
|
|
@@Get: |
2559 |
|
|
@@@nullCase: |
2560 |
|
|
@@@@enDesc: |
2561 |
|
|
If the algorithm returns <DOM::null>. |
2562 |
|
|
@@@NodeReadOnlyError: |
2563 |
|
|
@@@PerlDef: |
2564 |
|
|
__CODE{getReflectURIValue:: |
2565 |
|
|
$node => $self, |
2566 |
|
|
$namespaceURI => {<Q::atom|>}, |
2567 |
|
|
$localName => 'logo', |
2568 |
|
|
$r => $r, |
2569 |
|
|
}__; |
2570 |
|
|
@@Set: |
2571 |
|
|
@@@nullCase: |
2572 |
|
|
@@@@enDesc: |
2573 |
|
|
Removes the value. |
2574 |
|
|
@@@NodeReadOnlyError: |
2575 |
|
|
@@@PerlDef: |
2576 |
|
|
__CODE{setReflectURIValue:: |
2577 |
|
|
$node => $self, |
2578 |
|
|
$namespaceURI => {<Q::atom|>}, |
2579 |
|
|
$localName => 'logo', |
2580 |
|
|
$given => $given, |
2581 |
|
|
}__; |
2582 |
|
|
|
2583 |
|
|
@Attr: |
2584 |
|
|
@@Name: rightsElement |
2585 |
|
|
@@enDesc: |
2586 |
|
|
The <XE::atom|rights> child element of the node. |
2587 |
|
|
@@Type: AtomRightsElement |
2588 |
|
|
@@Get: |
2589 |
|
|
@@@enDesc: |
2590 |
|
|
It <kwd:MUST> <I::return a <XE::atom|rights> child element> |
2591 |
|
|
of the node. |
2592 |
|
|
@@@nullCase: |
2593 |
|
|
@@@@enDesc: |
2594 |
|
|
If the algorithm returns <DOM::null>. |
2595 |
|
|
@@@NodeReadOnlyError: |
2596 |
|
|
@@@PerlDef: |
2597 |
|
|
__CODE{returnChildElement:: |
2598 |
|
|
$node => $self, |
2599 |
|
|
$namespaceURI => {<Q::atom|>}, |
2600 |
|
|
$localName => 'rights', |
2601 |
|
|
$r => $r, |
2602 |
|
|
}__; |
2603 |
|
|
|
2604 |
|
|
@Attr: |
2605 |
|
|
@@Name: subtitleElement |
2606 |
|
|
@@enDesc: |
2607 |
|
|
The <XE::atom|subtitle> child element of the node. |
2608 |
|
|
@@Type: AtomSubtitleElement |
2609 |
|
|
@@Get: |
2610 |
|
|
@@@enDesc: |
2611 |
|
|
It <kwd:MUST> <I::return a <XE::atom|subtitle> child element> |
2612 |
|
|
of the node. |
2613 |
|
|
@@@nullCase: |
2614 |
|
|
@@@@enDesc: |
2615 |
|
|
If the algorithm returns <DOM::null>. |
2616 |
|
|
@@@NodeReadOnlyError: |
2617 |
|
|
@@@PerlDef: |
2618 |
|
|
__CODE{returnChildElement:: |
2619 |
|
|
$node => $self, |
2620 |
|
|
$namespaceURI => {<Q::atom|>}, |
2621 |
|
|
$localName => 'subtitle', |
2622 |
|
|
$r => $r, |
2623 |
|
|
}__; |
2624 |
|
|
|
2625 |
|
|
@Attr: |
2626 |
|
|
@@Name: titleElement |
2627 |
|
|
@@enDesc: |
2628 |
|
|
The <XE::atom|title> child element of the node. |
2629 |
|
|
@@Type: AtomTitleElement |
2630 |
|
|
@@Get: |
2631 |
|
|
@@@enDesc: |
2632 |
|
|
It <kwd:MUST> <I::return a <XE::atom|title> child element> |
2633 |
|
|
of the node. |
2634 |
|
|
@@@nullCase: |
2635 |
|
|
@@@@enDesc: |
2636 |
|
|
If the algorithm returns <DOM::null>. |
2637 |
|
|
@@@NodeReadOnlyError: |
2638 |
|
|
@@@PerlDef: |
2639 |
|
|
__CODE{returnChildElement:: |
2640 |
|
|
$node => $self, |
2641 |
|
|
$namespaceURI => {<Q::atom|>}, |
2642 |
|
|
$localName => 'title', |
2643 |
|
|
$r => $r, |
2644 |
|
|
}__; |
2645 |
|
|
|
2646 |
|
|
@Attr: |
2647 |
|
|
@@Name: updatedElement |
2648 |
|
|
@@enDesc: |
2649 |
|
|
The <XE::atom|updated> child element of the node. |
2650 |
|
|
@@Type: AtomUpdatedElement |
2651 |
|
|
@@Get: |
2652 |
|
|
@@@enDesc: |
2653 |
|
|
It <kwd:MUST> <I::return a <XE::atom|updated> child element> |
2654 |
|
|
of the node. |
2655 |
|
|
@@@nullCase: |
2656 |
|
|
@@@@enDesc: |
2657 |
|
|
If the algorithm returns <DOM::null>. |
2658 |
|
|
@@@NodeReadOnlyError: |
2659 |
|
|
@@@PerlDef: |
2660 |
|
|
__CODE{returnChildElement:: |
2661 |
|
|
$node => $self, |
2662 |
|
|
$namespaceURI => {<Q::atom|>}, |
2663 |
|
|
$localName => 'updated', |
2664 |
|
|
$r => $r, |
2665 |
|
|
}__; |
2666 |
|
|
|
2667 |
|
|
@Attr: |
2668 |
|
|
@@Name: entryElements |
2669 |
|
|
@@enDesc: |
2670 |
|
|
A static list of <XE::atom|entry> child elements of the node. |
2671 |
|
|
@@Type: StaticNodeList |
2672 |
|
|
@@Get: |
2673 |
|
|
@@@enDesc: |
2674 |
|
|
It <kwd:MUST> <I::return a <XE::atom|entry> child element list> |
2675 |
|
|
of the node. |
2676 |
|
|
@@@PerlDef: |
2677 |
|
|
__CODE{returnChildElementList:: |
2678 |
|
|
$node => $self, |
2679 |
|
|
$namespaceURI => {<Q::atom|>}, |
2680 |
|
|
$localName => 'entry', |
2681 |
|
|
$r => $r, |
2682 |
|
|
}__; |
2683 |
|
|
|
2684 |
|
|
@Method: |
2685 |
|
|
@@Name: getEntryElementById |
2686 |
|
|
@@enDesc: |
2687 |
|
|
Returns an <XE::atom|entry> node selected by its <XE::atom|id>. |
2688 |
|
|
@@Param: |
2689 |
|
|
@@@Name: idArg |
2690 |
|
|
@@@Type: DOMString |
2691 |
|
|
@@@actualType: DOMURI |
2692 |
|
|
@@@enDesc: |
2693 |
|
|
The identifier of the entry. |
2694 |
|
|
@@Return: |
2695 |
|
|
@@@Type: AtomEntryElement |
2696 |
|
|
@@@enDesc: |
2697 |
|
|
The <XE::atom|entry> element whose identifier equals to |
2698 |
|
|
<P::id>. |
2699 |
|
|
|
2700 |
|
|
It <kwd:MUST> return the first child element node in document |
2701 |
|
|
order whose element type is <XE::atom|entry> and |
2702 |
|
|
whose first child element node in document order |
2703 |
|
|
with element type <XE::atom|id> has <A::Node.textContent> |
2704 |
|
|
equals to <P::id>, if any, or <DOM::null>. |
2705 |
|
|
@@@nullCase: |
2706 |
|
|
@@@@enDesc: |
2707 |
|
|
If no matching element. |
2708 |
|
|
@@@PerlDef: |
2709 |
|
|
E: { |
2710 |
|
|
no warnings 'uninitialized'; |
2711 |
|
|
for my $cn (@{$self-><AG::Node.childNodes>}) { |
2712 |
|
|
if ($cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
2713 |
|
|
$cn-><AG::Node.localName> eq 'entry' and |
2714 |
|
|
$cn-><AG::Node.namespaceURI> eq <Q::atom|>) { |
2715 |
|
|
if ($cn-><AG::AtomEntryElement.id> eq $idArg) { |
2716 |
|
|
$r = $cn; |
2717 |
|
|
last E; |
2718 |
|
|
} |
2719 |
|
|
} |
2720 |
|
|
} |
2721 |
|
|
} # E |
2722 |
|
|
|
2723 |
|
|
@Method: |
2724 |
|
|
@@Name: addNewEntry |
2725 |
|
|
@@enDesc: |
2726 |
|
|
Creates an <XA::atom|entry> element node and |
2727 |
|
|
appends to the node. |
2728 |
|
|
@@Param: |
2729 |
|
|
@@@Name: id |
2730 |
|
|
@@@Type: DOMString |
2731 |
|
|
@@@actualType: DOMURI |
2732 |
|
|
@@@enDesc: |
2733 |
|
|
The <XE::atom|id> of the entry. |
2734 |
|
|
@@Param: |
2735 |
|
|
@@@Name: title |
2736 |
|
|
@@@Type: DOMString |
2737 |
|
|
@@@enDesc: |
2738 |
|
|
The <XE::atom|title> of the entry. |
2739 |
|
|
@@@nullCase: |
2740 |
|
|
@@@@enDesc: |
2741 |
|
|
The implementation <kwd:MUST> treate <DOM::null> |
2742 |
|
|
as if an empty string is specified. |
2743 |
|
|
@@Param: |
2744 |
|
|
@@@Name: lang |
2745 |
|
|
@@@Type: DOMString |
2746 |
|
|
@@@enDesc: |
2747 |
|
|
The natural language of the entry. |
2748 |
|
|
@@@nullCase: |
2749 |
|
|
@@@@enDesc: |
2750 |
|
|
No explicit language specification is added. |
2751 |
|
|
@@Return: |
2752 |
|
|
@@@Type: AtomEntryElement |
2753 |
|
|
@@@enDesc: |
2754 |
|
|
The newly created <XE::atom|entry> element. |
2755 |
|
|
|
2756 |
|
|
{P:: The newly created <XE::atom|entry> element node <kwd:MUST> |
2757 |
|
|
have attributes set as: |
2758 |
|
|
|
2759 |
|
|
- <A::Node.attributes>::: A <IF::NamedNodeMap> that contains |
2760 |
|
|
at least a new <XA::xml|lang> |
2761 |
|
|
attribute node except when |
2762 |
|
|
the <P::lang> parameter is set |
2763 |
|
|
to <DOM::null>. |
2764 |
|
|
|
2765 |
|
|
- <A::Node.childNodes>::: A <IF::NodeList> containing |
2766 |
|
|
a new <XE::atom|id> element node, |
2767 |
|
|
a new <XE::atom|title> element node, and |
2768 |
|
|
a new <XE::atom|updated> element node |
2769 |
|
|
in any order. |
2770 |
|
|
|
2771 |
|
|
} |
2772 |
|
|
|
2773 |
|
|
This element node <kwd:MUST> be appended to the node |
2774 |
|
|
as if the <M::Node.appendChild> method were invoked |
2775 |
|
|
on the node and <kwd:MUST> be returned by the method. |
2776 |
|
|
Note that an exception might be thrown during this course. |
2777 |
|
|
|
2778 |
|
|
{P:: The <XA::xml|lang> attribute node, if created, <kwd:MUST> |
2779 |
|
|
have attributes set as: |
2780 |
|
|
|
2781 |
|
|
- <A::Node.nodeValue>::: <P::lang>. |
2782 |
|
|
|
2783 |
|
|
- <A::Attr.specified>::: <DOM::true>. |
2784 |
|
|
|
2785 |
|
|
} |
2786 |
|
|
|
2787 |
|
|
{P:: The newly created <XE::atom|id> element node <kwd:MUST> |
2788 |
|
|
have attributes set as: |
2789 |
|
|
|
2790 |
|
|
- <A::Node.textContent>::: <P::id>. |
2791 |
|
|
|
2792 |
|
|
} |
2793 |
|
|
|
2794 |
|
|
{P:: The newly created <XE::atom|title> element node <kwd:MUST> |
2795 |
|
|
have attributes set as: |
2796 |
|
|
|
2797 |
|
|
- <A::Node.textContent>::: <P::title>. |
2798 |
|
|
|
2799 |
|
|
} |
2800 |
|
|
|
2801 |
|
|
The <XA::type> attribute node <kwd:MUST-NOT> be attached |
2802 |
|
|
to the <XE::atom|title> element node. |
2803 |
|
|
|
2804 |
|
|
{P:: The newly created <XE::atom|updated> element node <kwd:MUST> |
2805 |
|
|
have attributes set as: |
2806 |
|
|
|
2807 |
|
|
- <A::Node.textContent>::: A uppercase RFC 3339 <CODE::date-time> |
2808 |
|
|
representation of the time when the method is invoked. |
2809 |
|
|
The implementation <kwd:MAY> align its timezone to |
2810 |
|
|
that of the environment in which the method is invoked. |
2811 |
|
|
|
2812 |
|
|
} |
2813 |
|
|
@@@PerlDef: |
2814 |
|
|
__DEEP{ |
2815 |
|
|
my $od = $self-><AG::Node.ownerDocument>; |
2816 |
|
|
|
2817 |
|
|
$r = $od-><M::Document.createElementNS> (<Q::atom|>, 'entry'); |
2818 |
|
|
$r-><AS::Node.manakaiLanguage> ($lang) if defined $lang; |
2819 |
|
|
|
2820 |
|
|
$r-><AS::AtomFeedElement.id> ($id); |
2821 |
|
|
|
2822 |
|
|
my $titlee = $od-><M::Document.createElementNS> (<Q::atom|>, 'title'); |
2823 |
|
|
$titlee-><AS::Node.textContent> (defined $title ? $title : ''); |
2824 |
|
|
$r-><M::Node.appendChild> ($titlee); |
2825 |
|
|
|
2826 |
|
|
my $updatede = $od-><M::Document.createElementNS> |
2827 |
|
|
(<Q::atom|>, 'updated'); |
2828 |
|
|
$updatede-><AS::AtomDateConstruct.value> (scalar time); |
2829 |
|
|
$r-><M::Node.appendChild> ($updatede); |
2830 |
wakaba |
1.12 |
|
2831 |
|
|
$self-><M::Node.appendChild> ($r); |
2832 |
wakaba |
1.1 |
}__; |
2833 |
|
|
|
2834 |
|
|
@@Test: |
2835 |
|
|
@@@QName: AtomFeedElement.addNewEntry.1.test |
2836 |
|
|
@@@PerlDef: |
2837 |
|
|
my $doc; |
2838 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
2839 |
|
|
|
2840 |
|
|
my $feed = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed'); |
2841 |
|
|
|
2842 |
|
|
my $ent = $feed-><M::AtomFeedElement.addNewEntry> |
2843 |
|
|
('about:id', 'entry title', 'en'); |
2844 |
|
|
|
2845 |
|
|
$test->id ('entry.interface'); |
2846 |
|
|
$test->assert_isa ($ent, <IFName::AtomEntryElement>); |
2847 |
|
|
|
2848 |
|
|
$test->id ('entry.namespaceURI'); |
2849 |
|
|
$test->assert_equals ($ent-><AG::Node.namespaceURI>, <Q::atom|>); |
2850 |
|
|
|
2851 |
|
|
$test->id ('entry.localName'); |
2852 |
|
|
$test->assert_equals ($ent-><AG::Node.localName>, 'entry'); |
2853 |
|
|
|
2854 |
|
|
$test->id ('entry.lang'); |
2855 |
|
|
$test->assert_equals ($ent-><M::Element.getAttributeNS> |
2856 |
|
|
(<Q::xml|>, 'lang'), |
2857 |
|
|
'en'); |
2858 |
|
|
|
2859 |
|
|
my $id; |
2860 |
|
|
my $title; |
2861 |
|
|
my $updated; |
2862 |
|
|
|
2863 |
|
|
for my $cn (@{$ent-><AG::Node.childNodes>}) { |
2864 |
|
|
if ($cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
2865 |
|
|
$cn-><AG::Node.namespaceURI> eq <Q::atom|>) { |
2866 |
|
|
if ($cn-><AG::Node.localName> eq 'id') { |
2867 |
|
|
$id = $cn; |
2868 |
|
|
} elsif ($cn-><AG::Node.localName> eq 'title') { |
2869 |
|
|
$title = $cn; |
2870 |
|
|
} elsif ($cn-><AG::Node.localName> eq 'updated') { |
2871 |
|
|
$updated = $cn; |
2872 |
|
|
} |
2873 |
|
|
} |
2874 |
|
|
} |
2875 |
|
|
|
2876 |
|
|
$test->id ('id'); |
2877 |
|
|
$test->assert_not_null ($id); |
2878 |
|
|
|
2879 |
|
|
$test->id ('id.value'); |
2880 |
|
|
$test->assert_equals ($id-><AG::Node.textContent>, 'about:id'); |
2881 |
|
|
|
2882 |
|
|
$test->id ('title'); |
2883 |
|
|
$test->assert_not_null ($title); |
2884 |
|
|
|
2885 |
|
|
$test->id ('title.value'); |
2886 |
|
|
$test->assert_equals ($title-><AG::Node.textContent>, 'entry title'); |
2887 |
|
|
|
2888 |
|
|
$test->id ('title.type'); |
2889 |
|
|
$test->assert_null ($title-><M::Element.getAttributeNS> (null, 'type')); |
2890 |
|
|
|
2891 |
|
|
$test->id ('updated'); |
2892 |
|
|
$test->assert_not_null ($updated); |
2893 |
|
|
|
2894 |
|
|
$test->id ('updated.value'); |
2895 |
|
|
$test->assert_num_not_equals |
2896 |
|
|
(actual_value => $updated-><AG::AtomDateConstruct.value>, |
2897 |
|
|
expected_value => 0); |
2898 |
wakaba |
1.12 |
|
2899 |
|
|
$test->id ('parent'); |
2900 |
|
|
$test->assert_equals ($ent-><AG::Node.parentNode>, $feed); |
2901 |
wakaba |
1.1 |
@@Test: |
2902 |
|
|
@@@QName: AtomFeedElement.addNewEntry.2.test |
2903 |
|
|
@@@enDesc: |
2904 |
|
|
<DOM::null> <CODE::lang>. |
2905 |
|
|
@@@PerlDef: |
2906 |
|
|
my $doc; |
2907 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
2908 |
|
|
|
2909 |
|
|
my $feed = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed'); |
2910 |
|
|
|
2911 |
|
|
my $ent = $feed-><M::AtomFeedElement.addNewEntry> |
2912 |
|
|
('about:id', 'entry title', null); |
2913 |
|
|
|
2914 |
|
|
$test->id ('entry.lang'); |
2915 |
|
|
$test->assert_null ($ent-><M::Element.getAttributeNS> |
2916 |
|
|
(<Q::xml|>, 'lang')); |
2917 |
|
|
##AtomFeedElement |
2918 |
|
|
|
2919 |
wakaba |
1.8 |
ECDef: |
2920 |
|
|
@QName: entry-prop |
2921 |
|
|
@mv:elementTypeClassName: entry-prop |
2922 |
|
|
@mv:refers: atom|author |
2923 |
|
|
@mv:refers: atom|category |
2924 |
|
|
@mv:refers: atom|content |
2925 |
|
|
@mv:refers: atom|contributor |
2926 |
|
|
@mv:refers: atom|id |
2927 |
|
|
@mv:refers: atom|link |
2928 |
|
|
@mv:refers: atom|published |
2929 |
|
|
@mv:refers: atom|rights |
2930 |
|
|
@mv:refers: atom|source |
2931 |
|
|
@mv:refers: atom|summary |
2932 |
|
|
@mv:refers: atom|title |
2933 |
|
|
@mv:refers: atom|updated |
2934 |
|
|
@mv:refers: extensionElements |
2935 |
|
|
|
2936 |
wakaba |
1.1 |
IFClsETDef: |
2937 |
|
|
@IFQName: AtomEntryElement |
2938 |
|
|
@ETQName: atom|entry |
2939 |
|
|
@ETRQName: atom|entry |
2940 |
|
|
@ClsQName: ManakaiAtomEntryElement |
2941 |
|
|
|
2942 |
|
|
@IFISA: AtomElement |
2943 |
|
|
@ClsISA: ManakaiAtomElement |
2944 |
|
|
|
2945 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
2946 |
wakaba |
1.10 |
@mv:refers: atomCommonAttributes |
2947 |
|
|
|
2948 |
wakaba |
1.9 |
@cm: |
2949 |
|
|
(entry-prop+) |
2950 |
|
|
|
2951 |
wakaba |
1.1 |
@enDesc: |
2952 |
|
|
The <XE::atom|entry> element represents an individual |
2953 |
|
|
entry, acting as a container for metadata and data |
2954 |
|
|
associated with the entry. |
2955 |
|
|
|
2956 |
|
|
@Attr: |
2957 |
|
|
@@Name: authorElements |
2958 |
|
|
@@enDesc: |
2959 |
|
|
A static list of <XE::atom|author> child elements of the node. |
2960 |
|
|
@@Type: StaticNodeList |
2961 |
|
|
@@Get: |
2962 |
|
|
@@@enDesc: |
2963 |
|
|
It <kwd:MUST> <I::return a <XE::atom|author> child element list> |
2964 |
|
|
of the node. |
2965 |
|
|
@@@disDef: |
2966 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.authorElements.get |
2967 |
|
|
|
2968 |
|
|
@Attr: |
2969 |
|
|
@@Name: entryAuthorElements |
2970 |
|
|
@@enDesc: |
2971 |
|
|
A static list of <XE::atom|author> elements for the node. |
2972 |
|
|
@@Type: StaticNodeList |
2973 |
|
|
@@Get: |
2974 |
|
|
@@@enDesc: |
2975 |
|
|
= If the node contains one or more <XE::atom|author> |
2976 |
|
|
element node in its child node list, then it |
2977 |
|
|
<kwd:MUST> return a <IF::StaticNodeList> that |
2978 |
|
|
would be returned by the <A::AtomEntryElement.authorElements> |
2979 |
|
|
attribute of the node. |
2980 |
|
|
|
2981 |
|
|
= Otherwise, if the node contains a <XE::atom|source> |
2982 |
|
|
element node in its child node list, then it |
2983 |
|
|
<kwd:MUST> return a <IF::StaticNodeList> that |
2984 |
|
|
would be returned by the <A::AtomSourceElement.authorElements> |
2985 |
|
|
attribute of that node, unless its <A::NodeList.length> |
2986 |
|
|
is zero. |
2987 |
|
|
|
2988 |
|
|
= Otherwise, if the <A::Node.parentNode> of the |
2989 |
|
|
node is a <XE::atom|feed> element node, then |
2990 |
|
|
it <kwd:MUST> return a <IF::StaticNodeList> that |
2991 |
|
|
would be returned by the <A::AtomFeedElement.authorElements> |
2992 |
|
|
attribute of that node. |
2993 |
|
|
|
2994 |
|
|
= Otherwise, it <kwd:MUST> return a <IF::StaticNodeList> |
2995 |
|
|
whose <A::NodeList.length> is zero. |
2996 |
|
|
@@@PerlDef: |
2997 |
|
|
__DEEP{ |
2998 |
|
|
E: { |
2999 |
|
|
no warnings 'uninitialized'; |
3000 |
|
|
__CODE{tc|createStaticNodeList:: $r => $r}__; |
3001 |
|
|
|
3002 |
|
|
my $source; |
3003 |
|
|
for my $cn (@{$self-><AG::Node.childNodes>}) { |
3004 |
|
|
if ($cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
3005 |
|
|
$cn-><AG::Node.namespaceURI> eq <Q::atom|>) { |
3006 |
|
|
if ($cn-><AG::Node.localName> eq 'author') { |
3007 |
|
|
push @{$r}, $cn; |
3008 |
|
|
} elsif ($cn-><AG::Node.localName> eq 'source') { |
3009 |
|
|
$source = $cn; |
3010 |
|
|
} |
3011 |
|
|
} |
3012 |
|
|
} |
3013 |
|
|
last E unless @{$r} == 0; |
3014 |
|
|
|
3015 |
|
|
if (defined $source) { |
3016 |
|
|
$r = $source-><AG::AtomSourceElement.authorElements>; |
3017 |
|
|
} |
3018 |
|
|
last E unless @{$r} == 0; |
3019 |
|
|
|
3020 |
|
|
my $parent = $self-><AG::Node.parentNode>; |
3021 |
|
|
if (defined $parent and |
3022 |
|
|
$parent-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
3023 |
|
|
$parent-><AG::Node.namespaceURI> eq <Q::atom|> and |
3024 |
|
|
$parent-><AG::Node.localName> eq 'feed') { |
3025 |
|
|
$r = $parent-><AG::AtomFeedElement.authorElements>; |
3026 |
|
|
} |
3027 |
|
|
} # E |
3028 |
|
|
}__; |
3029 |
|
|
|
3030 |
|
|
@@Test: |
3031 |
|
|
@@@QName: AtomEntryElement.entryAuthorElements.1.test |
3032 |
|
|
@@@PerlDef: |
3033 |
|
|
my $doc; |
3034 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
3035 |
|
|
|
3036 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'entry'); |
3037 |
|
|
|
3038 |
|
|
|
3039 |
|
|
$test->id ('empty'); |
3040 |
|
|
my $list = $el-><AG::AtomEntryElement.entryAuthorElements>; |
3041 |
|
|
$test->assert_num_equals (actual_value => 0+@$list, expected_value => 0); |
3042 |
|
|
|
3043 |
|
|
$test->id ('one'); |
3044 |
|
|
$el-><M::Node.appendChild> |
3045 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3046 |
|
|
$list = $el-><AG::AtomEntryElement.entryAuthorElements>; |
3047 |
|
|
$test->assert_num_equals (actual_value => 0+@$list, expected_value => 1); |
3048 |
|
|
|
3049 |
|
|
$test->id ('source'); |
3050 |
|
|
for ($el-><M::Node.appendChild> |
3051 |
|
|
($doc-><M::Document.createElementNS> |
3052 |
|
|
(<Q::atom|>, 'source'))) { |
3053 |
|
|
$_-><M::Node.appendChild> |
3054 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3055 |
|
|
$_-><M::Node.appendChild> |
3056 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3057 |
|
|
} |
3058 |
|
|
$list = $el-><AG::AtomEntryElement.entryAuthorElements>; |
3059 |
|
|
$test->assert_num_equals (actual_value => 0+@$list, expected_value => 1); |
3060 |
|
|
|
3061 |
|
|
$test->id ('parent'); |
3062 |
|
|
for ($doc-><M::Document.createElementNS> (<Q::atom|>, 'feed')) { |
3063 |
|
|
$_-><M::Node.appendChild> |
3064 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3065 |
|
|
$_-><M::Node.appendChild> |
3066 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3067 |
|
|
$_-><M::Node.appendChild> |
3068 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3069 |
|
|
$_-><M::Node.appendChild> ($el); |
3070 |
|
|
} |
3071 |
|
|
$list = $el-><AG::AtomEntryElement.entryAuthorElements>; |
3072 |
|
|
$test->assert_num_equals (actual_value => 0+@$list, expected_value => 1); |
3073 |
|
|
@@Test: |
3074 |
|
|
@@@QName: AtomEntryElement.entryAuthorElements.2.test |
3075 |
|
|
@@@PerlDef: |
3076 |
|
|
my $doc; |
3077 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
3078 |
|
|
|
3079 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'entry'); |
3080 |
|
|
|
3081 |
|
|
$test->id ('source'); |
3082 |
|
|
for ($el-><M::Node.appendChild> |
3083 |
|
|
($doc-><M::Document.createElementNS> |
3084 |
|
|
(<Q::atom|>, 'source'))) { |
3085 |
|
|
$_-><M::Node.appendChild> |
3086 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3087 |
|
|
$_-><M::Node.appendChild> |
3088 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3089 |
|
|
} |
3090 |
|
|
my $list = $el-><AG::AtomEntryElement.entryAuthorElements>; |
3091 |
|
|
$test->assert_num_equals (actual_value => 0+@$list, expected_value => 2); |
3092 |
|
|
|
3093 |
|
|
$test->id ('parent'); |
3094 |
|
|
for ($doc-><M::Document.createElementNS> (<Q::atom|>, 'feed')) { |
3095 |
|
|
$_-><M::Node.appendChild> |
3096 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3097 |
|
|
$_-><M::Node.appendChild> |
3098 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3099 |
|
|
$_-><M::Node.appendChild> |
3100 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3101 |
|
|
$_-><M::Node.appendChild> ($el); |
3102 |
|
|
} |
3103 |
|
|
$list = $el-><AG::AtomEntryElement.entryAuthorElements>; |
3104 |
|
|
$test->assert_num_equals (actual_value => 0+@$list, expected_value => 2); |
3105 |
|
|
@@Test: |
3106 |
|
|
@@@QName: AtomEntryElement.entryAuthorElements.3.test |
3107 |
|
|
@@@PerlDef: |
3108 |
|
|
my $doc; |
3109 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
3110 |
|
|
|
3111 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'entry'); |
3112 |
|
|
|
3113 |
|
|
$test->id ('source'); |
3114 |
|
|
for ($el-><M::Node.appendChild> |
3115 |
|
|
($doc-><M::Document.createElementNS> |
3116 |
|
|
(<Q::atom|>, 'source'))) { |
3117 |
|
|
# empty |
3118 |
|
|
} |
3119 |
|
|
my $list = $el-><AG::AtomEntryElement.entryAuthorElements>; |
3120 |
|
|
$test->assert_num_equals (actual_value => 0+@$list, expected_value => 0); |
3121 |
|
|
|
3122 |
|
|
$test->id ('parent'); |
3123 |
wakaba |
1.20 |
my $parent; |
3124 |
wakaba |
1.1 |
for ($doc-><M::Document.createElementNS> (<Q::atom|>, 'feed')) { |
3125 |
wakaba |
1.20 |
$parent = $_; |
3126 |
wakaba |
1.1 |
$_-><M::Node.appendChild> |
3127 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3128 |
|
|
$_-><M::Node.appendChild> |
3129 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3130 |
|
|
$_-><M::Node.appendChild> |
3131 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3132 |
|
|
$_-><M::Node.appendChild> ($el); |
3133 |
|
|
} |
3134 |
|
|
$list = $el-><AG::AtomEntryElement.entryAuthorElements>; |
3135 |
|
|
$test->assert_num_equals (actual_value => 0+@$list, expected_value => 3); |
3136 |
|
|
@@Test: |
3137 |
|
|
@@@QName: AtomEntryElement.entryAuthorElements.4.test |
3138 |
|
|
@@@PerlDef: |
3139 |
|
|
my $doc; |
3140 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
3141 |
|
|
|
3142 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'entry'); |
3143 |
|
|
|
3144 |
|
|
$test->id ('parent'); |
3145 |
wakaba |
1.20 |
my $parent; |
3146 |
wakaba |
1.1 |
for ($doc-><M::Document.createElementNS> (<Q::atom|>, 'feed')) { |
3147 |
wakaba |
1.20 |
$parent = $_; |
3148 |
wakaba |
1.1 |
$_-><M::Node.appendChild> |
3149 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3150 |
|
|
$_-><M::Node.appendChild> |
3151 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3152 |
|
|
$_-><M::Node.appendChild> |
3153 |
|
|
($doc-><M::Document.createElementNS> (<Q::atom|>, 'author')); |
3154 |
|
|
$_-><M::Node.appendChild> ($el); |
3155 |
|
|
} |
3156 |
|
|
my $list = $el-><AG::AtomEntryElement.entryAuthorElements>; |
3157 |
|
|
$test->assert_num_equals (actual_value => 0+@$list, expected_value => 3); |
3158 |
|
|
|
3159 |
|
|
@Attr: |
3160 |
|
|
@@Name: categoryElements |
3161 |
|
|
@@enDesc: |
3162 |
|
|
A static list of <XE::atom|category> child elements of the node. |
3163 |
|
|
@@Type: StaticNodeList |
3164 |
|
|
@@Get: |
3165 |
|
|
@@@enDesc: |
3166 |
|
|
It <kwd:MUST> <I::return a <XE::atom|category> child element list> |
3167 |
|
|
of the node. |
3168 |
|
|
@@@disDef: |
3169 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.categoryElements.get |
3170 |
wakaba |
1.2 |
|
3171 |
|
|
@Attr: |
3172 |
|
|
@@Name: contentElement |
3173 |
|
|
@@enDesc: |
3174 |
|
|
The <XE::atom|content> child element of the node. |
3175 |
|
|
@@Type: AtomContentElement |
3176 |
|
|
@@Get: |
3177 |
|
|
@@@enDesc: |
3178 |
|
|
It <kwd:MUST> <I::return a <XE::atom|content> child element> |
3179 |
|
|
of the node. |
3180 |
|
|
@@@nullCase: |
3181 |
|
|
@@@@enDesc: |
3182 |
|
|
If the algorithm returns <DOM::null>. |
3183 |
|
|
@@@NodeReadOnlyError: |
3184 |
|
|
@@@PerlDef: |
3185 |
|
|
__CODE{returnChildElement:: |
3186 |
|
|
$node => $self, |
3187 |
|
|
$namespaceURI => {<Q::atom|>}, |
3188 |
|
|
$localName => 'content', |
3189 |
|
|
$r => $r, |
3190 |
|
|
}__; |
3191 |
wakaba |
1.1 |
|
3192 |
|
|
@Attr: |
3193 |
|
|
@@Name: contributorElements |
3194 |
|
|
@@enDesc: |
3195 |
|
|
A static list of <XE::atom|contributor> child elements of the node. |
3196 |
|
|
@@Type: StaticNodeList |
3197 |
|
|
@@Get: |
3198 |
|
|
@@@enDesc: |
3199 |
|
|
It <kwd:MUST> <I::return a <XE::atom|contributor> child element list> |
3200 |
|
|
of the node. |
3201 |
|
|
@@@disDef: |
3202 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.contributorElements.get |
3203 |
|
|
|
3204 |
|
|
@Attr: |
3205 |
|
|
@@Name: id |
3206 |
|
|
@@enDesc: |
3207 |
|
|
The <XE::atom|id> value of the feed. |
3208 |
|
|
|
3209 |
|
|
It <kwd:MUST> <I::reflect the string value |
3210 |
|
|
of the <XE::atom|id> child element> of the node. |
3211 |
|
|
@@Type: DOMString |
3212 |
|
|
@@actualType: DOMURI |
3213 |
|
|
@@Get: |
3214 |
|
|
@@@nullCase: |
3215 |
|
|
@@@@enDesc: |
3216 |
|
|
If the algorithm returns <DOM::null>. |
3217 |
|
|
@@@NodeReadOnlyError: |
3218 |
|
|
@@@disDef: |
3219 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.id.get |
3220 |
|
|
@@Set: |
3221 |
|
|
@@@nullCase: |
3222 |
|
|
@@@@enDesc: |
3223 |
|
|
Removes the value. |
3224 |
|
|
@@@NodeReadOnlyError: |
3225 |
|
|
@@@disDef: |
3226 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.id.set |
3227 |
|
|
|
3228 |
|
|
@Attr: |
3229 |
|
|
@@Name: linkElements |
3230 |
|
|
@@enDesc: |
3231 |
|
|
A static list of <XE::atom|link> child elements of the node. |
3232 |
|
|
@@Type: StaticNodeList |
3233 |
|
|
@@Get: |
3234 |
|
|
@@@enDesc: |
3235 |
|
|
It <kwd:MUST> <I::return a <XE::atom|link> child element list> |
3236 |
|
|
of the node. |
3237 |
|
|
@@@disDef: |
3238 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.linkElements.get |
3239 |
|
|
|
3240 |
|
|
@Attr: |
3241 |
|
|
@@Name: publishedElement |
3242 |
|
|
@@enDesc: |
3243 |
|
|
The <XE::atom|published> child element of the node. |
3244 |
|
|
@@Type: AtomPublishedElement |
3245 |
|
|
@@Get: |
3246 |
|
|
@@@enDesc: |
3247 |
|
|
It <kwd:MUST> <I::return a <XE::atom|published> child element> |
3248 |
|
|
of the node. |
3249 |
|
|
@@@nullCase: |
3250 |
|
|
@@@@enDesc: |
3251 |
|
|
If the algorithm returns <DOM::null>. |
3252 |
|
|
@@@NodeReadOnlyError: |
3253 |
|
|
@@@PerlDef: |
3254 |
|
|
__CODE{returnChildElement:: |
3255 |
|
|
$node => $self, |
3256 |
|
|
$namespaceURI => {<Q::atom|>}, |
3257 |
|
|
$localName => 'published', |
3258 |
|
|
$r => $r, |
3259 |
|
|
}__; |
3260 |
|
|
|
3261 |
|
|
@Attr: |
3262 |
|
|
@@Name: rightsElement |
3263 |
|
|
@@enDesc: |
3264 |
|
|
The <XE::atom|rights> child element of the node. |
3265 |
|
|
@@Type: AtomRightsElement |
3266 |
|
|
@@Get: |
3267 |
|
|
@@@enDesc: |
3268 |
|
|
It <kwd:MUST> <I::return a <XE::atom|rights> child element> |
3269 |
|
|
of the node. |
3270 |
|
|
@@@nullCase: |
3271 |
|
|
@@@@enDesc: |
3272 |
|
|
If the algorithm returns <DOM::null>. |
3273 |
|
|
@@@NodeReadOnlyError: |
3274 |
|
|
@@@disDef: |
3275 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.rightsElement.get |
3276 |
|
|
|
3277 |
|
|
@Attr: |
3278 |
|
|
@@Name: entryRightsElement |
3279 |
|
|
@@enDesc: |
3280 |
|
|
The <XE::atom|rights> element for the node. |
3281 |
|
|
@@Type: AtomRightsElement |
3282 |
|
|
@@Get: |
3283 |
|
|
@@@enDesc: |
3284 |
|
|
= If the node contains a <XE::atom|rights> |
3285 |
|
|
element node in its child node list, then it |
3286 |
|
|
<kwd:MUST> return the first such a node in document order. |
3287 |
|
|
|
3288 |
|
|
= Otherwise, if the <A::Node.parentNode> of the |
3289 |
|
|
node is a <XE::atom|feed> element node, then |
3290 |
|
|
it <kwd:MUST> return an <IF::AtomRightsElement> |
3291 |
|
|
that would be returned by the <A::AtomFeedElement.rightsElement> |
3292 |
|
|
attribute of that node, except when it is <DOM::null>. |
3293 |
|
|
|
3294 |
|
|
{OLI:: Otherwise, |
3295 |
|
|
|
3296 |
|
|
{OLI:: If the <cfg::cfg|create-child-element> configuration |
3297 |
|
|
parameter is set to <DOM::true>, |
3298 |
|
|
|
3299 |
|
|
= Create an element node <VAR::N> whose element type |
3300 |
|
|
is <XE::atom|rights>. |
3301 |
|
|
|
3302 |
|
|
= Append <VAR::N> to this node as if the <M::Node.appendChild> |
3303 |
|
|
method were called for the node with its parameter |
3304 |
|
|
set to <VAR::N>. Note that this might throw an exception. |
3305 |
|
|
|
3306 |
|
|
= Then, <VAR::N> <kwd:MUST> be returned. |
3307 |
|
|
|
3308 |
|
|
} |
3309 |
|
|
|
3310 |
|
|
= Otherwise, it <kwd:MUST> return <DOM::null>. |
3311 |
|
|
} |
3312 |
|
|
@@@nullCase: |
3313 |
|
|
@@@@enDesc: |
3314 |
|
|
If the algorithm returns <DOM::null>. |
3315 |
|
|
@@@NodeReadOnlyError: |
3316 |
|
|
@@@PerlDef: |
3317 |
|
|
__DEEP{ |
3318 |
|
|
E: { |
3319 |
|
|
no warnings 'uninitialized'; |
3320 |
|
|
for my $cn (@{$self-><AG::Node.childNodes>}) { |
3321 |
|
|
if ($cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
3322 |
|
|
$cn-><AG::Node.localName> eq 'rights' and |
3323 |
|
|
$cn-><AG::Node.namespaceURI> eq <Q::atom|>) { |
3324 |
|
|
$r = $cn; |
3325 |
|
|
last E; |
3326 |
|
|
} |
3327 |
|
|
} |
3328 |
|
|
|
3329 |
|
|
my $parent = $self-><AG::Node.parentNode>; |
3330 |
|
|
if (defined $parent and |
3331 |
|
|
$parent-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
3332 |
|
|
$parent-><AG::Node.namespaceURI> eq <Q::atom|> and |
3333 |
|
|
$parent-><AG::Node.localName> eq 'feed') { |
3334 |
|
|
for my $cn (@{$parent-><AG::Node.childNodes>}) { |
3335 |
|
|
if ($cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and |
3336 |
|
|
$cn-><AG::Node.localName> eq 'rights' and |
3337 |
|
|
$cn-><AG::Node.namespaceURI> eq <Q::atom|>) { |
3338 |
|
|
$r = $cn; |
3339 |
|
|
last E; |
3340 |
|
|
} |
3341 |
|
|
} |
3342 |
|
|
} |
3343 |
|
|
|
3344 |
|
|
my $od = $self-><AG::Node.ownerDocument>; |
3345 |
|
|
if ($od-><AG::Document.domConfig> |
3346 |
|
|
-><M::CFG.getParameter> (<Q::cfg|create-child-element>)) { |
3347 |
|
|
$r = $od-><M::Document.createElementNS> (<Q::atom|>, 'rights'); |
3348 |
|
|
$self-><M::Node.appendChild> ($r); |
3349 |
|
|
} |
3350 |
|
|
} # E |
3351 |
|
|
}__; |
3352 |
|
|
|
3353 |
|
|
@@Test: |
3354 |
|
|
@@@QName: AtomEntryElement.entryRightsElement.1.test |
3355 |
|
|
@@@PerlDef: |
3356 |
|
|
my $doc; |
3357 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
3358 |
|
|
|
3359 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'entry'); |
3360 |
|
|
|
3361 |
|
|
$test->id ('no'); |
3362 |
|
|
my $rights = $el-><AG::AtomEntryElement.entryRightsElement>; |
3363 |
|
|
$test->assert_null ($rights); |
3364 |
|
|
|
3365 |
|
|
$doc-><AG::Document.domConfig> |
3366 |
|
|
-><M::CFG.setParameter> (<Q::cfg|create-child-element> => true); |
3367 |
|
|
|
3368 |
|
|
$rights = $el-><AG::AtomEntryElement.entryRightsElement>; |
3369 |
|
|
|
3370 |
|
|
$test->id ('created.namespaceURI'); |
3371 |
|
|
$test->assert_equals ($rights-><AG::Node.namespaceURI>, <Q::atom|>); |
3372 |
|
|
|
3373 |
|
|
$test->id ('created.localName'); |
3374 |
|
|
$test->assert_equals ($rights-><AG::Node.localName>, 'rights'); |
3375 |
|
|
|
3376 |
|
|
$test->id ('created.parentNode'); |
3377 |
|
|
$test->assert_equals ($rights-><AG::Node.parentNode>, $el); |
3378 |
|
|
|
3379 |
|
|
$test->id ('get'); |
3380 |
|
|
my $rights2 = $el-><AG::AtomEntryElement.entryRightsElement>; |
3381 |
|
|
$test->assert_equals ($rights2, $rights); |
3382 |
|
|
@@Test: |
3383 |
|
|
@@@QName: AtomEntryElement.entryRightsElement.2.test |
3384 |
|
|
@@@PerlDef: |
3385 |
|
|
my $doc; |
3386 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
3387 |
|
|
|
3388 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'entry'); |
3389 |
|
|
|
3390 |
|
|
my $feed = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed'); |
3391 |
|
|
$feed-><M::Node.appendChild> ($el); |
3392 |
|
|
my $rights = $doc-><M::Document.createElementNS> (<Q::atom|>, 'rights'); |
3393 |
|
|
$feed-><M::Node.appendChild> ($rights); |
3394 |
|
|
|
3395 |
|
|
$test->id ('get'); |
3396 |
|
|
my $rights2 = $el-><AG::AtomEntryElement.entryRightsElement>; |
3397 |
|
|
$test->assert_equals ($rights2, $rights); |
3398 |
|
|
|
3399 |
|
|
@Attr: |
3400 |
|
|
@@Name: sourceElement |
3401 |
|
|
@@enDesc: |
3402 |
|
|
The <XE::atom|source> child element of the node. |
3403 |
|
|
@@Type: AtomSourceElement |
3404 |
|
|
@@Get: |
3405 |
|
|
@@@enDesc: |
3406 |
|
|
It <kwd:MUST> <I::return a <XE::atom|source> child element> |
3407 |
|
|
of the node. |
3408 |
|
|
@@@nullCase: |
3409 |
|
|
@@@@enDesc: |
3410 |
|
|
If the algorithm returns <DOM::null>. |
3411 |
|
|
@@@NodeReadOnlyError: |
3412 |
|
|
@@@PerlDef: |
3413 |
|
|
__CODE{returnChildElement:: |
3414 |
|
|
$node => $self, |
3415 |
|
|
$namespaceURI => {<Q::atom|>}, |
3416 |
|
|
$localName => 'source', |
3417 |
|
|
$r => $r, |
3418 |
|
|
}__; |
3419 |
|
|
|
3420 |
|
|
@Attr: |
3421 |
|
|
@@Name: summaryElement |
3422 |
|
|
@@enDesc: |
3423 |
|
|
The <XE::atom|summary> child element of the node. |
3424 |
|
|
@@Type: AtomSummaryElement |
3425 |
|
|
@@Get: |
3426 |
|
|
@@@enDesc: |
3427 |
|
|
It <kwd:MUST> <I::return a <XE::atom|summary> child element> |
3428 |
|
|
of the node. |
3429 |
|
|
@@@nullCase: |
3430 |
|
|
@@@@enDesc: |
3431 |
|
|
If the algorithm returns <DOM::null>. |
3432 |
|
|
@@@NodeReadOnlyError: |
3433 |
|
|
@@@PerlDef: |
3434 |
|
|
__CODE{returnChildElement:: |
3435 |
|
|
$node => $self, |
3436 |
|
|
$namespaceURI => {<Q::atom|>}, |
3437 |
|
|
$localName => 'summary', |
3438 |
|
|
$r => $r, |
3439 |
|
|
}__; |
3440 |
|
|
|
3441 |
|
|
@Attr: |
3442 |
|
|
@@Name: titleElement |
3443 |
|
|
@@enDesc: |
3444 |
|
|
The <XE::atom|title> child element of the node. |
3445 |
|
|
@@Type: AtomTitleElement |
3446 |
|
|
@@Get: |
3447 |
|
|
@@@enDesc: |
3448 |
|
|
It <kwd:MUST> <I::return a <XE::atom|title> child element> |
3449 |
|
|
of the node. |
3450 |
|
|
@@@nullCase: |
3451 |
|
|
@@@@enDesc: |
3452 |
|
|
If the algorithm returns <DOM::null>. |
3453 |
|
|
@@@NodeReadOnlyError: |
3454 |
|
|
@@@disDef: |
3455 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.titleElement.get |
3456 |
|
|
|
3457 |
|
|
@Attr: |
3458 |
|
|
@@Name: updatedElement |
3459 |
|
|
@@enDesc: |
3460 |
|
|
The <XE::atom|updated> child element of the node. |
3461 |
|
|
@@Type: AtomUpdatedElement |
3462 |
|
|
@@Get: |
3463 |
|
|
@@@enDesc: |
3464 |
|
|
It <kwd:MUST> <I::return a <XE::atom|updated> child element> |
3465 |
|
|
of the node. |
3466 |
|
|
@@@nullCase: |
3467 |
|
|
@@@@enDesc: |
3468 |
|
|
If the algorithm returns <DOM::null>. |
3469 |
|
|
@@@NodeReadOnlyError: |
3470 |
|
|
@@@disDef: |
3471 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.updatedElement.get |
3472 |
|
|
##AtomEntryElement |
3473 |
|
|
|
3474 |
|
|
IFClsETDef: |
3475 |
wakaba |
1.7 |
@IFQName: AtomIdElement |
3476 |
|
|
@ETQName: atom|id |
3477 |
|
|
@ETRQName: atom|id |
3478 |
|
|
@ClsQName: ManakaiAtomIdElement |
3479 |
|
|
|
3480 |
|
|
@IFISA: AtomElement |
3481 |
|
|
@ClsISA: ManakaiAtomElement |
3482 |
wakaba |
1.10 |
|
3483 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
3484 |
wakaba |
1.10 |
@mv:refers: atomCommonAttributes |
3485 |
wakaba |
1.9 |
|
3486 |
|
|
@cm: atomUriCM |
3487 |
wakaba |
1.7 |
##AtomIdElement |
3488 |
|
|
|
3489 |
|
|
IFClsETDef: |
3490 |
wakaba |
1.8 |
@IFQName: AtomIconElement |
3491 |
|
|
@ETQName: atom|icon |
3492 |
|
|
@ETRQName: atom|icon |
3493 |
|
|
@ClsQName: ManakaiAtomIconElement |
3494 |
|
|
|
3495 |
|
|
@IFISA: AtomElement |
3496 |
|
|
@ClsISA: ManakaiAtomElement |
3497 |
wakaba |
1.9 |
|
3498 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
3499 |
wakaba |
1.10 |
@mv:refers: atomCommonAttributes |
3500 |
|
|
|
3501 |
wakaba |
1.9 |
@cm: atomUriCM |
3502 |
wakaba |
1.8 |
##AtomIconElement |
3503 |
|
|
|
3504 |
|
|
IFClsETDef: |
3505 |
wakaba |
1.7 |
@IFQName: AtomNameElement |
3506 |
|
|
@ETQName: atom|name |
3507 |
|
|
@ETRQName: atom|name |
3508 |
|
|
@ClsQName: ManakaiAtomNameElement |
3509 |
|
|
|
3510 |
|
|
@IFISA: AtomElement |
3511 |
|
|
@ClsISA: ManakaiAtomElement |
3512 |
wakaba |
1.9 |
|
3513 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
3514 |
wakaba |
1.10 |
# no common attribs |
3515 |
wakaba |
1.9 |
@cm: TextCM |
3516 |
wakaba |
1.13 |
|
3517 |
|
|
@mv:refers: Atom |
3518 |
wakaba |
1.7 |
##AtomNameElement |
3519 |
|
|
|
3520 |
|
|
IFClsETDef: |
3521 |
|
|
@IFQName: AtomUriElement |
3522 |
|
|
@ETQName: atom|uri |
3523 |
|
|
@ETRQName: atom|uri |
3524 |
|
|
@ClsQName: ManakaiAtomUriElement |
3525 |
|
|
|
3526 |
|
|
@IFISA: AtomElement |
3527 |
|
|
@ClsISA: ManakaiAtomElement |
3528 |
wakaba |
1.9 |
|
3529 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
3530 |
wakaba |
1.10 |
# no common attribs |
3531 |
wakaba |
1.9 |
@cm: atomUriCM |
3532 |
wakaba |
1.13 |
|
3533 |
|
|
@mv:refers: Atom |
3534 |
wakaba |
1.7 |
##AtomUriElement |
3535 |
|
|
|
3536 |
|
|
IFClsETDef: |
3537 |
|
|
@IFQName: AtomEmailElement |
3538 |
|
|
@ETQName: atom|email |
3539 |
|
|
@ETRQName: atom|email |
3540 |
|
|
@ClsQName: ManakaiAtomEmailElement |
3541 |
|
|
|
3542 |
|
|
@IFISA: AtomElement |
3543 |
|
|
@ClsISA: ManakaiAtomElement |
3544 |
wakaba |
1.9 |
|
3545 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
3546 |
wakaba |
1.10 |
# no common attribs |
3547 |
wakaba |
1.9 |
@cm: atomEmailAddressCM |
3548 |
wakaba |
1.13 |
|
3549 |
|
|
@mv:refers: Atom |
3550 |
wakaba |
1.7 |
##AtomEmailElement |
3551 |
|
|
|
3552 |
|
|
IFClsETDef: |
3553 |
wakaba |
1.8 |
@IFQName: AtomLogoElement |
3554 |
|
|
@ETQName: atom|logo |
3555 |
|
|
@ETRQName: atom|logo |
3556 |
|
|
@ClsQName: ManakaiAtomLogoElement |
3557 |
|
|
|
3558 |
|
|
@IFISA: AtomElement |
3559 |
|
|
@ClsISA: ManakaiAtomElement |
3560 |
wakaba |
1.9 |
|
3561 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
3562 |
wakaba |
1.10 |
@mv:refers: atomCommonAttributes |
3563 |
|
|
|
3564 |
wakaba |
1.9 |
@cm: atomUriCM |
3565 |
wakaba |
1.8 |
##AtomLogoElement |
3566 |
|
|
|
3567 |
|
|
IFClsETDef: |
3568 |
wakaba |
1.1 |
@IFQName: AtomContentElement |
3569 |
|
|
@ETQName: atom|content |
3570 |
wakaba |
1.6 |
@ETRQName: atom|content |
3571 |
wakaba |
1.1 |
@ClsQName: ManakaiAtomContentElement |
3572 |
|
|
|
3573 |
|
|
@IFISA: AtomElement |
3574 |
|
|
@ClsISA: ManakaiAtomElement |
3575 |
|
|
|
3576 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
3577 |
wakaba |
1.10 |
@mv:refers: atomCommonAttributes |
3578 |
|
|
|
3579 |
wakaba |
1.9 |
@cm: |
3580 |
|
|
dxm|ANY||ManakaiDOM|all |
3581 |
|
|
|
3582 |
wakaba |
1.1 |
@enDesc: |
3583 |
|
|
The <XE::atom|content> element either contains or links to |
3584 |
|
|
the content of the entry. |
3585 |
|
|
|
3586 |
wakaba |
1.13 |
@ATTR: |
3587 |
wakaba |
1.1 |
@@Name: type |
3588 |
|
|
@@enDesc: |
3589 |
|
|
The type of the element. |
3590 |
|
|
|
3591 |
|
|
It <kwd:MUST> <I::reflect the string value |
3592 |
|
|
of the <XA::type> attribute> of the node. It default |
3593 |
|
|
value <kwd:MUST> be <CODE::text> if and only if |
3594 |
|
|
there is no <XA::src> attribute on the node. |
3595 |
|
|
@@Type: DOMString |
3596 |
|
|
@@Get: |
3597 |
|
|
@@@nullCase: |
3598 |
|
|
@@@@enDesc: |
3599 |
|
|
If the algorithm returns <DOM::null>. |
3600 |
|
|
@@@PerlDef: |
3601 |
|
|
__CODE{getReflectAttrStringValue:: |
3602 |
|
|
$node => $self, |
3603 |
|
|
$namespaceURI => {null}, |
3604 |
|
|
$localName => 'type', |
3605 |
|
|
$r => $r, |
3606 |
|
|
$defaultValue => { |
3607 |
|
|
$self-><M::Element.hasAttributeNS> (null, 'src') ? null : 'text' |
3608 |
|
|
}, |
3609 |
|
|
}__; |
3610 |
|
|
@@Set: |
3611 |
|
|
@@@nullCase: |
3612 |
|
|
@@@@enDesc: |
3613 |
|
|
Removes the attribute. |
3614 |
|
|
@@@NodeReadOnlyError: |
3615 |
|
|
@@@PerlDef: |
3616 |
|
|
__CODE{setReflectAttrStringValue:: |
3617 |
|
|
$node => $self, |
3618 |
|
|
$namespaceURI => {null}, |
3619 |
|
|
$localName => 'type', |
3620 |
|
|
$given => $given, |
3621 |
|
|
}__; |
3622 |
|
|
|
3623 |
|
|
@@Test: |
3624 |
|
|
@@@QName: AtomContentElement.type.test |
3625 |
|
|
@@@PerlDef: |
3626 |
|
|
my $doc; |
3627 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
3628 |
|
|
|
3629 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'content'); |
3630 |
|
|
|
3631 |
|
|
$test->id ('default.no.src'); |
3632 |
|
|
$test->assert_equals ($el-><AG::AtomContentElement.type>, 'text'); |
3633 |
|
|
|
3634 |
|
|
$test->id ('default.src'); |
3635 |
|
|
$el-><AS::AtomContentElement.src> ('http://atom.example/'); |
3636 |
|
|
$test->assert_null ($el-><AG::AtomContentElement.type>); |
3637 |
|
|
|
3638 |
|
|
$test->id ('set.xhtml'); |
3639 |
|
|
$el-><AS::AtomContentElement.type> ('xhtml'); |
3640 |
|
|
$test->assert_equals ($el-><AG::AtomContentElement.type>, 'xhtml'); |
3641 |
|
|
|
3642 |
|
|
$test->id ('set.imt'); |
3643 |
|
|
$el-><AS::AtomContentElement.type> ('application/xml'); |
3644 |
|
|
$test->assert_equals ($el-><AG::AtomContentElement.type>, |
3645 |
|
|
'application/xml'); |
3646 |
|
|
|
3647 |
|
|
$test->id ('remove'); |
3648 |
|
|
$el-><AS::AtomContentElement.type> (null); |
3649 |
|
|
$test->assert_null ($el-><AG::AtomContentElement.type>); |
3650 |
|
|
|
3651 |
wakaba |
1.13 |
@ATTR: |
3652 |
wakaba |
1.1 |
@@Name: src |
3653 |
|
|
@@enDesc: |
3654 |
|
|
The source of the remote content of the element. |
3655 |
|
|
|
3656 |
|
|
It <kwd:MUST> <I::reflect the string value |
3657 |
|
|
of the <XA::src> attribute> of the node. |
3658 |
|
|
@@Type: DOMString |
3659 |
|
|
@@Type: DOMURI |
3660 |
|
|
@@Get: |
3661 |
|
|
@@@nullCase: |
3662 |
|
|
@@@@enDesc: |
3663 |
|
|
If the algorithm returns <DOM::null>. |
3664 |
|
|
@@@PerlDef: |
3665 |
|
|
__CODE{getReflectAttrURIValue:: |
3666 |
|
|
$node => $self, |
3667 |
|
|
$namespaceURI => {null}, |
3668 |
|
|
$localName => 'src', |
3669 |
|
|
$r => $r, |
3670 |
|
|
$defaultValue => {null}, |
3671 |
|
|
}__; |
3672 |
|
|
@@Set: |
3673 |
|
|
@@@nullCase: |
3674 |
|
|
@@@@enDesc: |
3675 |
|
|
Removes the attribute. |
3676 |
|
|
@@@NodeReadOnlyError: |
3677 |
|
|
@@@PerlDef: |
3678 |
|
|
__CODE{setReflectAttrURIValue:: |
3679 |
|
|
$node => $self, |
3680 |
|
|
$namespaceURI => {null}, |
3681 |
|
|
$localName => 'src', |
3682 |
|
|
$given => $given, |
3683 |
|
|
}__; |
3684 |
|
|
|
3685 |
|
|
@@Test: |
3686 |
|
|
@@@QName: AtomContentElement.src.test |
3687 |
|
|
@@@PerlDef: |
3688 |
|
|
my $doc; |
3689 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
3690 |
|
|
|
3691 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'content'); |
3692 |
|
|
|
3693 |
|
|
$test->id ('default'); |
3694 |
|
|
$test->assert_null ($el-><AG::AtomContentElement.src>); |
3695 |
|
|
|
3696 |
|
|
$test->id ('set'); |
3697 |
|
|
$el-><AS::AtomContentElement.src> ('http://atom.example/'); |
3698 |
|
|
$test->assert_equals ($el-><AG::AtomContentElement.src>, |
3699 |
|
|
'http://atom.example/'); |
3700 |
|
|
|
3701 |
|
|
$test->id ('set.relative'); |
3702 |
|
|
$el-><AS::AtomContentElement.src> ('atom'); |
3703 |
|
|
$test->assert_equals ($el-><AG::AtomContentElement.src>, 'atom'); |
3704 |
|
|
|
3705 |
|
|
$test->id ('set.relative.base'); |
3706 |
|
|
$el-><M::Element.setAttributeNS> (<Q::xml|>, 'xml:base', |
3707 |
|
|
'http://atom.example/'); |
3708 |
|
|
$test->assert_equals ($el-><AG::AtomContentElement.src>, |
3709 |
|
|
'http://atom.example/atom'); |
3710 |
|
|
|
3711 |
|
|
$test->id ('remove'); |
3712 |
|
|
$el-><AS::AtomContentElement.src> (null); |
3713 |
|
|
$test->assert_null ($el-><AG::AtomContentElement.src>); |
3714 |
|
|
|
3715 |
|
|
@Attr: |
3716 |
|
|
@@Name: container |
3717 |
|
|
@@enDesc: |
3718 |
|
|
The container element that contains the actual content for the node. |
3719 |
|
|
@@Type: Element |
3720 |
|
|
@@Get: |
3721 |
|
|
@@@enDesc: |
3722 |
|
|
- If the <A::AtomContentElement.type> is <CODE::xhtml>, |
3723 |
|
|
it <kwd:MUST> <I::return the <XE::html|div> child element>. |
3724 |
|
|
|
3725 |
|
|
- Otherwise, if the <A::AtomContentElement.src> is <DOM::null>, |
3726 |
|
|
it <kwd:MUST> return <DOM::null>. |
3727 |
|
|
|
3728 |
|
|
- Otherwise, it <kwd:MUST> return the node itself. |
3729 |
|
|
@@@nullCase: |
3730 |
|
|
@@@@enDesc: |
3731 |
|
|
If the algorithm returns <DOM::null>. |
3732 |
|
|
@@@NodeReadOnlyError: |
3733 |
|
|
@@@PerlDef: |
3734 |
|
|
__DEEP{ |
3735 |
|
|
my $type = $self-><AG::AtomContentElement.type>; |
3736 |
|
|
if (defined $type and $type eq 'xhtml') { |
3737 |
|
|
__UNDEEP{ |
3738 |
|
|
__CODE{returnChildElement:: |
3739 |
|
|
$node => $self, |
3740 |
|
|
$namespaceURI => {<Q::html|>}, |
3741 |
|
|
$localName => 'div', |
3742 |
|
|
$r => $r, |
3743 |
|
|
}__; |
3744 |
|
|
}__; |
3745 |
|
|
} elsif (not $self-><M::Element.hasAttributeNS> (null, 'src')) { |
3746 |
|
|
$r = $self; |
3747 |
|
|
} |
3748 |
|
|
}__; |
3749 |
|
|
|
3750 |
|
|
@@Test: |
3751 |
|
|
@@@QName: AtomContentElement.container.1.test |
3752 |
|
|
@@@PerlDef: |
3753 |
|
|
my $doc; |
3754 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
3755 |
|
|
|
3756 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'content'); |
3757 |
|
|
|
3758 |
|
|
$test->id ('no'); |
3759 |
|
|
$test->assert_equals ($el-><AG::AtomContentElement.container>, $el); |
3760 |
|
|
|
3761 |
|
|
$test->id ('application/smil'); |
3762 |
|
|
$el-><AS::AtomContentElement.type> ('application/smil'); |
3763 |
|
|
$test->assert_equals ($el-><AG::AtomContentElement.container>, $el); |
3764 |
|
|
|
3765 |
|
|
$test->id ('text'); |
3766 |
|
|
$el-><AS::AtomContentElement.type> ('text'); |
3767 |
|
|
$test->assert_equals ($el-><AG::AtomContentElement.container>, $el); |
3768 |
|
|
|
3769 |
|
|
$test->id ('html'); |
3770 |
|
|
$el-><AS::AtomContentElement.type> ('html'); |
3771 |
|
|
$test->assert_equals ($el-><AG::AtomContentElement.container>, $el); |
3772 |
|
|
|
3773 |
|
|
$test->id ('xhtml'); |
3774 |
|
|
$el-><AS::AtomContentElement.type> ('xhtml'); |
3775 |
|
|
$test->assert_null ($el-><AG::AtomContentElement.container>); |
3776 |
|
|
|
3777 |
|
|
$doc-><AG::Document.domConfig> |
3778 |
|
|
-><M::CFG.setParameter> (<Q::cfg|create-child-element> => true); |
3779 |
|
|
my $con = $el-><AG::AtomContentElement.container>; |
3780 |
|
|
|
3781 |
|
|
$test->id ('xhtml.create'); |
3782 |
|
|
$test->assert_not_equals ($con, $el); |
3783 |
|
|
|
3784 |
|
|
$test->id ('xhtml.namespaceURI'); |
3785 |
|
|
$test->assert_equals ($con-><AG::Node.namespaceURI>, <Q::html|>); |
3786 |
|
|
|
3787 |
|
|
$test->id ('xhtml.localName'); |
3788 |
|
|
$test->assert_equals ($con-><AG::Node.localName>, 'div'); |
3789 |
|
|
|
3790 |
|
|
$test->id ('xhtml.parentNode'); |
3791 |
|
|
$test->assert_equals ($con-><AG::Node.parentNode>, $el); |
3792 |
|
|
|
3793 |
|
|
$test->id ('xhtml.2'); |
3794 |
|
|
$test->assert_equals ($el-><AG::AtomContentElement.container>, $con); |
3795 |
|
|
@@Test: |
3796 |
|
|
@@@QName: AtomContentElement.container.2.test |
3797 |
|
|
@@@enDesc: |
3798 |
|
|
With <XA::src>. |
3799 |
|
|
@@@PerlDef: |
3800 |
|
|
my $doc; |
3801 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
3802 |
|
|
|
3803 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'content'); |
3804 |
|
|
|
3805 |
|
|
$el-><AS::AtomContentElement.src> ('http://www.example.com/'); |
3806 |
|
|
|
3807 |
|
|
$test->id ('no'); |
3808 |
|
|
$test->assert_null ($el-><AG::AtomContentElement.container>); |
3809 |
|
|
|
3810 |
|
|
$test->id ('application/smil'); |
3811 |
|
|
$el-><AS::AtomContentElement.type> ('application/smil'); |
3812 |
|
|
$test->assert_null ($el-><AG::AtomContentElement.container>); |
3813 |
|
|
|
3814 |
|
|
@enImplNote: |
3815 |
|
|
@@ddid: base64 |
3816 |
|
|
@@@: |
3817 |
|
|
{TODO:: |
3818 |
|
|
Access to Base64'ed content is necessary. |
3819 |
|
|
} |
3820 |
|
|
##AtomContentElement |
3821 |
|
|
|
3822 |
|
|
IFClsETDef: |
3823 |
|
|
@IFQName: AtomAuthorElement |
3824 |
|
|
@ETQName: atom|author |
3825 |
wakaba |
1.6 |
@ETRQName: atom|author |
3826 |
wakaba |
1.1 |
@ClsQName: ManakaiAtomAuthorElement |
3827 |
|
|
|
3828 |
|
|
@IFISA: AtomPersonConstruct |
3829 |
|
|
@ClsISA: ManakaiAtomPersonConstruct |
3830 |
wakaba |
1.14 |
|
3831 |
|
|
@f:implements: AtomFeature10 |
3832 |
wakaba |
1.8 |
@mv:refers: PersonAG |
3833 |
wakaba |
1.7 |
@mv:elementContentModel: PersonCM |
3834 |
wakaba |
1.1 |
|
3835 |
|
|
@enDesc: |
3836 |
|
|
The <XE::atom|author> element is a Person construct that |
3837 |
|
|
indicates the author of the entry or feed. |
3838 |
|
|
##AtomAuthorElement |
3839 |
|
|
|
3840 |
|
|
IFClsETDef: |
3841 |
|
|
@IFQName: AtomCategoryElement |
3842 |
|
|
@ETQName: atom|category |
3843 |
wakaba |
1.6 |
@ETRQName: atom|category |
3844 |
wakaba |
1.1 |
@ClsQName: ManakaiAtomCategoryElement |
3845 |
|
|
|
3846 |
|
|
@IFISA: AtomElement |
3847 |
|
|
@ClsISA: ManakaiAtomElement |
3848 |
|
|
|
3849 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
3850 |
wakaba |
1.10 |
@mv:refers: atomCommonAttributes |
3851 |
|
|
|
3852 |
wakaba |
1.9 |
@cm: undefinedContent |
3853 |
|
|
|
3854 |
wakaba |
1.1 |
@enDesc: |
3855 |
|
|
The <XE::atom|category> element conveys information abut |
3856 |
|
|
a category associated with an entry or feed. |
3857 |
|
|
|
3858 |
|
|
@Attr: |
3859 |
|
|
@@Name: term |
3860 |
|
|
@@enDesc: |
3861 |
|
|
The <XA::term> attribute of the element. |
3862 |
|
|
|
3863 |
|
|
It <kwd:MUST> <I::reflect the string value |
3864 |
|
|
of the <XA::term> attribute> of the node. |
3865 |
|
|
@@Type: DOMString |
3866 |
|
|
@@Get: |
3867 |
|
|
@@@nullCase: |
3868 |
|
|
@@@@enDesc: |
3869 |
|
|
If the algorithm returns <DOM::null>. |
3870 |
|
|
@@@PerlDef: |
3871 |
|
|
__CODE{getReflectAttrStringValue:: |
3872 |
|
|
$node => $self, |
3873 |
|
|
$namespaceURI => {null}, |
3874 |
|
|
$localName => 'term', |
3875 |
|
|
$r => $r, |
3876 |
|
|
$defaultValue => {null}, |
3877 |
|
|
}__; |
3878 |
|
|
@@Set: |
3879 |
|
|
@@@nullCase: |
3880 |
|
|
@@@@enDesc: |
3881 |
|
|
Removes the attribute. |
3882 |
|
|
@@@NodeReadOnlyError: |
3883 |
|
|
@@@PerlDef: |
3884 |
|
|
__CODE{setReflectAttrStringValue:: |
3885 |
|
|
$node => $self, |
3886 |
|
|
$namespaceURI => {null}, |
3887 |
|
|
$localName => 'term', |
3888 |
|
|
$given => $given, |
3889 |
|
|
}__; |
3890 |
|
|
|
3891 |
|
|
@Attr: |
3892 |
|
|
@@Name: scheme |
3893 |
|
|
@@enDesc: |
3894 |
|
|
The categorization scheme of the element. |
3895 |
|
|
|
3896 |
|
|
It <kwd:MUST> <I::reflect the URI value |
3897 |
|
|
of the <XA::scheme> attribute> of the node. |
3898 |
|
|
@@Type: DOMString |
3899 |
|
|
@@Type: DOMURI |
3900 |
|
|
@@Get: |
3901 |
|
|
@@@nullCase: |
3902 |
|
|
@@@@enDesc: |
3903 |
|
|
If the algorithm returns <DOM::null>. |
3904 |
|
|
@@@PerlDef: |
3905 |
|
|
__CODE{getReflectAttrURIValue:: |
3906 |
|
|
$node => $self, |
3907 |
|
|
$namespaceURI => {null}, |
3908 |
|
|
$localName => 'scheme', |
3909 |
|
|
$r => $r, |
3910 |
|
|
$defaultValue => {null}, |
3911 |
|
|
}__; |
3912 |
|
|
@@Set: |
3913 |
|
|
@@@nullCase: |
3914 |
|
|
@@@@enDesc: |
3915 |
|
|
Removes the attribute. |
3916 |
|
|
@@@NodeReadOnlyError: |
3917 |
|
|
@@@PerlDef: |
3918 |
|
|
__CODE{setReflectAttrURIValue:: |
3919 |
|
|
$node => $self, |
3920 |
|
|
$namespaceURI => {null}, |
3921 |
|
|
$localName => 'scheme', |
3922 |
|
|
$given => $given, |
3923 |
|
|
}__; |
3924 |
|
|
|
3925 |
|
|
@Attr: |
3926 |
|
|
@@Name: label |
3927 |
|
|
@@enDesc: |
3928 |
|
|
The <XA::label> attribute of the element. |
3929 |
|
|
|
3930 |
|
|
It <kwd:MUST> <I::reflect the string value |
3931 |
|
|
of the <XA::label> attribute> of the node. |
3932 |
|
|
@@Type: DOMString |
3933 |
|
|
@@Get: |
3934 |
|
|
@@@nullCase: |
3935 |
|
|
@@@@enDesc: |
3936 |
|
|
If the algorithm returns <DOM::null>. |
3937 |
|
|
@@@PerlDef: |
3938 |
|
|
__CODE{getReflectAttrStringValue:: |
3939 |
|
|
$node => $self, |
3940 |
|
|
$namespaceURI => {null}, |
3941 |
|
|
$localName => 'label', |
3942 |
|
|
$r => $r, |
3943 |
|
|
$defaultValue => {null}, |
3944 |
|
|
}__; |
3945 |
|
|
@@Set: |
3946 |
|
|
@@@nullCase: |
3947 |
|
|
@@@@enDesc: |
3948 |
|
|
Removes the attribute. |
3949 |
|
|
@@@NodeReadOnlyError: |
3950 |
|
|
@@@PerlDef: |
3951 |
|
|
__CODE{setReflectAttrStringValue:: |
3952 |
|
|
$node => $self, |
3953 |
|
|
$namespaceURI => {null}, |
3954 |
|
|
$localName => 'label', |
3955 |
|
|
$given => $given, |
3956 |
|
|
}__; |
3957 |
|
|
##AtomCategoryElement |
3958 |
|
|
|
3959 |
|
|
IFClsETDef: |
3960 |
|
|
@IFQName: AtomContributorElement |
3961 |
|
|
@ETQName: atom|contributor |
3962 |
wakaba |
1.6 |
@ETRQName: atom|contributor |
3963 |
wakaba |
1.1 |
@ClsQName: ManakaiAtomContributorElement |
3964 |
|
|
|
3965 |
|
|
@IFISA: AtomPersonConstruct |
3966 |
|
|
@ClsISA: ManakaiAtomPersonConstruct |
3967 |
wakaba |
1.14 |
|
3968 |
|
|
@f:implements: AtomFeature10 |
3969 |
wakaba |
1.8 |
@mv:refers: PersonAG |
3970 |
wakaba |
1.7 |
@mv:elementContentModel: PersonCM |
3971 |
wakaba |
1.1 |
|
3972 |
|
|
@enDesc: |
3973 |
|
|
The <XE::atom|contributor> element is a Person construct that |
3974 |
|
|
indicates a person or other entity who contributed to the entry |
3975 |
|
|
or feed. |
3976 |
|
|
##AtomContributorElement |
3977 |
|
|
|
3978 |
|
|
IFClsETDef: |
3979 |
|
|
@IFQName: AtomGeneratorElement |
3980 |
|
|
@ETQName: atom|generator |
3981 |
wakaba |
1.6 |
@ETRQName: atom|generator |
3982 |
wakaba |
1.1 |
@ClsQName: ManakaiAtomGeneratorElement |
3983 |
|
|
|
3984 |
|
|
@IFISA: AtomElement |
3985 |
|
|
@ClsISA: ManakaiAtomElement |
3986 |
|
|
|
3987 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
3988 |
wakaba |
1.10 |
@mv:refers: atomCommonAttributes |
3989 |
|
|
|
3990 |
wakaba |
1.9 |
@cm: |
3991 |
|
|
(dxm|PCDATA||ManakaiDOM|all)* |
3992 |
|
|
|
3993 |
wakaba |
1.1 |
@enDesc: |
3994 |
|
|
The <XE::atom|generator> element identifies the agent used |
3995 |
|
|
to generate a feed. |
3996 |
|
|
|
3997 |
|
|
@Attr: |
3998 |
|
|
@@Name: uri |
3999 |
|
|
@@enDesc: |
4000 |
|
|
The URI attribute of the element. |
4001 |
|
|
|
4002 |
|
|
It <kwd:MUST> <I::reflect the URI value |
4003 |
|
|
of the <XA::uri> attribute> of the node. |
4004 |
|
|
@@Type: DOMString |
4005 |
|
|
@@Type: DOMURI |
4006 |
|
|
@@Get: |
4007 |
|
|
@@@nullCase: |
4008 |
|
|
@@@@enDesc: |
4009 |
|
|
If the algorithm returns <DOM::null>. |
4010 |
|
|
@@@PerlDef: |
4011 |
|
|
__CODE{getReflectAttrURIValue:: |
4012 |
|
|
$node => $self, |
4013 |
|
|
$namespaceURI => {null}, |
4014 |
|
|
$localName => 'uri', |
4015 |
|
|
$r => $r, |
4016 |
|
|
$defaultValue => {null}, |
4017 |
|
|
}__; |
4018 |
|
|
@@Set: |
4019 |
|
|
@@@nullCase: |
4020 |
|
|
@@@@enDesc: |
4021 |
|
|
Removes the attribute. |
4022 |
|
|
@@@NodeReadOnlyError: |
4023 |
|
|
@@@PerlDef: |
4024 |
|
|
__CODE{setReflectAttrURIValue:: |
4025 |
|
|
$node => $self, |
4026 |
|
|
$namespaceURI => {null}, |
4027 |
|
|
$localName => 'uri', |
4028 |
|
|
$given => $given, |
4029 |
|
|
}__; |
4030 |
|
|
|
4031 |
|
|
@Attr: |
4032 |
|
|
@@Name: version |
4033 |
|
|
@@enDesc: |
4034 |
|
|
The <XA::version> attribute of the element. |
4035 |
|
|
|
4036 |
|
|
It <kwd:MUST> <I::reflect the string value |
4037 |
|
|
of the <XA::version> attribute> of the node. |
4038 |
|
|
@@Type: DOMString |
4039 |
|
|
@@Get: |
4040 |
|
|
@@@nullCase: |
4041 |
|
|
@@@@enDesc: |
4042 |
|
|
If the algorithm returns <DOM::null>. |
4043 |
|
|
@@@PerlDef: |
4044 |
|
|
__CODE{getReflectAttrStringValue:: |
4045 |
|
|
$node => $self, |
4046 |
|
|
$namespaceURI => {null}, |
4047 |
|
|
$localName => 'version', |
4048 |
|
|
$r => $r, |
4049 |
|
|
$defaultValue => {null}, |
4050 |
|
|
}__; |
4051 |
|
|
@@Set: |
4052 |
|
|
@@@nullCase: |
4053 |
|
|
@@@@enDesc: |
4054 |
|
|
Removes the attribute. |
4055 |
|
|
@@@NodeReadOnlyError: |
4056 |
|
|
@@@PerlDef: |
4057 |
|
|
__CODE{setReflectAttrStringValue:: |
4058 |
|
|
$node => $self, |
4059 |
|
|
$namespaceURI => {null}, |
4060 |
|
|
$localName => 'version', |
4061 |
|
|
$given => $given, |
4062 |
|
|
}__; |
4063 |
|
|
##AtomGeneratorElement |
4064 |
|
|
|
4065 |
|
|
IFClsETDef: |
4066 |
|
|
@IFQName: AtomLinkElement |
4067 |
|
|
@ETQName: atom|link |
4068 |
wakaba |
1.6 |
@ETRQName: atom|link |
4069 |
wakaba |
1.1 |
@ClsQName: ManakaiAtomLinkElement |
4070 |
|
|
|
4071 |
|
|
@IFISA: AtomElement |
4072 |
|
|
@ClsISA: ManakaiAtomElement |
4073 |
|
|
|
4074 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
4075 |
wakaba |
1.10 |
@mv:refers: atomCommonAttributes |
4076 |
|
|
|
4077 |
wakaba |
1.9 |
@cm: undefinedContent |
4078 |
|
|
|
4079 |
wakaba |
1.1 |
@enDesc: |
4080 |
|
|
The <XE::atom|link> element defines a reference from an entry |
4081 |
|
|
or feed to a Web resource. |
4082 |
|
|
|
4083 |
wakaba |
1.6 |
@ATTR: |
4084 |
wakaba |
1.1 |
@@Name: href |
4085 |
|
|
@@enDesc: |
4086 |
|
|
The <XA::href> attribute of the element. |
4087 |
|
|
|
4088 |
|
|
It <kwd:MUST> <I::reflect the URI value |
4089 |
|
|
of the <XA::href> attribute> of the node. |
4090 |
|
|
@@Type: DOMString |
4091 |
wakaba |
1.6 |
@@actualType: DOMURI |
4092 |
wakaba |
1.1 |
@@Get: |
4093 |
|
|
@@@nullCase: |
4094 |
|
|
@@@@enDesc: |
4095 |
|
|
If the algorithm returns <DOM::null>. |
4096 |
|
|
@@@PerlDef: |
4097 |
|
|
__CODE{getReflectAttrURIValue:: |
4098 |
|
|
$node => $self, |
4099 |
|
|
$namespaceURI => {null}, |
4100 |
|
|
$localName => 'href', |
4101 |
|
|
$r => $r, |
4102 |
|
|
$defaultValue => {null}, |
4103 |
|
|
}__; |
4104 |
|
|
@@Set: |
4105 |
|
|
@@@nullCase: |
4106 |
|
|
@@@@enDesc: |
4107 |
|
|
Removes the attribute. |
4108 |
|
|
@@@NodeReadOnlyError: |
4109 |
|
|
@@@PerlDef: |
4110 |
|
|
__CODE{setReflectAttrURIValue:: |
4111 |
|
|
$node => $self, |
4112 |
|
|
$namespaceURI => {null}, |
4113 |
|
|
$localName => 'href', |
4114 |
|
|
$given => $given, |
4115 |
|
|
}__; |
4116 |
|
|
|
4117 |
wakaba |
1.6 |
@ATTR: |
4118 |
wakaba |
1.1 |
@@Name: rel |
4119 |
|
|
@@enDesc: |
4120 |
|
|
The <XA::rel> attribute of the element. |
4121 |
|
|
|
4122 |
|
|
It <kwd:MUST> <I::reflect the string value |
4123 |
|
|
of the <XA::rel> attribute> of the node, with |
4124 |
|
|
a few exceptions. The default value <kwd:MUST> |
4125 |
|
|
be <URI^DISCore|QName::rel|alternate>. |
4126 |
|
|
@@Type: DOMString |
4127 |
wakaba |
1.6 |
@@actualType: DOMURI |
4128 |
wakaba |
1.1 |
@@Get: |
4129 |
|
|
@@@enDesc: |
4130 |
|
|
If the algorithm returns a string that does not contain |
4131 |
|
|
any <CHAR::COLON> character, the string |
4132 |
|
|
<URI^DISCore|QName::rel|> <kwd:MUST> be prepended |
4133 |
|
|
for the return value of the getter. |
4134 |
|
|
@@@PerlDef: |
4135 |
|
|
__CODE{getReflectAttrStringValue:: |
4136 |
|
|
$node => $self, |
4137 |
|
|
$namespaceURI => {null}, |
4138 |
|
|
$localName => 'rel', |
4139 |
|
|
$r => $r, |
4140 |
|
|
$defaultValue => {<Q::rel|alternate>}, |
4141 |
|
|
}__; |
4142 |
|
|
if (defined $r and index ($r, ':') == -1) { |
4143 |
|
|
$r = <Q::rel|> . $r; |
4144 |
|
|
} |
4145 |
|
|
@@Set: |
4146 |
|
|
@@@enDesc: |
4147 |
|
|
If the given value starts with <URI^DISCore|QName::rel|> (by |
4148 |
|
|
simple character-by-character comparison), such substring |
4149 |
|
|
<kwd:MUST> be removed for the purpose of the setter algorithm, |
4150 |
|
|
if and only if the result string is not empty and does contain |
4151 |
|
|
none of <CHAR::COLON>, <CHAR::SOLIDUS>, <CHAR::QUESTION MARK>, |
4152 |
|
|
and <CHAR::NUMBER SIGN>. |
4153 |
|
|
@@@nullCase: |
4154 |
|
|
@@@@enDesc: |
4155 |
|
|
Removes the attribute. |
4156 |
|
|
@@@NodeReadOnlyError: |
4157 |
|
|
@@@PerlDef: |
4158 |
|
|
if (defined $given) { |
4159 |
|
|
$given =~ s[\Ahttp://www.iana.org/assignments/relation/([^:/?#]+)\z] |
4160 |
|
|
[$1]; |
4161 |
|
|
} |
4162 |
|
|
__CODE{setReflectAttrStringValue:: |
4163 |
|
|
$node => $self, |
4164 |
|
|
$namespaceURI => {null}, |
4165 |
|
|
$localName => 'rel', |
4166 |
|
|
$given => $given, |
4167 |
|
|
}__; |
4168 |
|
|
|
4169 |
|
|
@@Test: |
4170 |
|
|
@@@QName: AtomLinkElement.rel.test |
4171 |
|
|
@@@PerlDef: |
4172 |
|
|
my $doc; |
4173 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
4174 |
|
|
|
4175 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'link'); |
4176 |
|
|
|
4177 |
|
|
$test->id ('default'); |
4178 |
|
|
$test->assert_equals ($el-><AG::AtomLinkElement.rel>, |
4179 |
|
|
<Q::rel|alternate>); |
4180 |
|
|
|
4181 |
|
|
$test->id ('set'); |
4182 |
|
|
$el-><AS::AtomLinkElement.rel> ('http://www.example.com/'); |
4183 |
|
|
$test->assert_equals ($el-><AG::AtomLinkElement.rel>, |
4184 |
|
|
'http://www.example.com/'); |
4185 |
|
|
|
4186 |
|
|
$test->id ('set.self'); |
4187 |
|
|
$el-><AS::AtomLinkElement.rel> ('self'); |
4188 |
|
|
$test->assert_equals ($el-><AG::AtomLinkElement.rel>, |
4189 |
|
|
<Q::rel|self>); |
4190 |
|
|
|
4191 |
|
|
$test->id ('set.qrelated'); |
4192 |
|
|
$el-><AS::AtomLinkElement.rel> (<Q::rel|related>); |
4193 |
|
|
$test->assert_equals ($el-><AG::AtomLinkElement.rel>, |
4194 |
|
|
<Q::rel|related>); |
4195 |
|
|
|
4196 |
|
|
$test->id ('remove'); |
4197 |
|
|
$el-><AS::AtomLinkElement.rel> (null); |
4198 |
|
|
$test->assert_equals ($el-><AG::AtomLinkElement.rel>, |
4199 |
|
|
<Q::rel|alternate>); |
4200 |
|
|
|
4201 |
wakaba |
1.6 |
@ATTR: |
4202 |
wakaba |
1.1 |
@@Name: type |
4203 |
|
|
@@enDesc: |
4204 |
|
|
The <XA::type> attribute of the element. |
4205 |
|
|
|
4206 |
|
|
It <kwd:MUST> <I::reflect the string value |
4207 |
|
|
of the <XA::type> attribute> of the node. |
4208 |
|
|
@@Type: DOMString |
4209 |
|
|
@@Get: |
4210 |
wakaba |
1.14 |
@@@enDesc: |
4211 |
|
|
{P:: If the feature <Feature^^DISCore|QName::AtomThreadingFeature10> |
4212 |
|
|
is supported, the attribute getter <kwd:MUST> return |
4213 |
|
|
the string <CODE::application/atom+xml> when both of the |
4214 |
|
|
following conditions are met: |
4215 |
|
|
|
4216 |
|
|
- The attribute getter would otherwise return <DOM::null>. |
4217 |
|
|
|
4218 |
|
|
- The <A::AtomLinkElement.rel> attribute contains |
4219 |
|
|
a string value of <URI^^DISCore|QName::rel|replies>. |
4220 |
|
|
|
4221 |
|
|
} |
4222 |
wakaba |
1.1 |
@@@nullCase: |
4223 |
|
|
@@@@enDesc: |
4224 |
|
|
If the algorithm returns <DOM::null>. |
4225 |
|
|
@@@PerlDef: |
4226 |
|
|
__CODE{getReflectAttrStringValue:: |
4227 |
|
|
$node => $self, |
4228 |
|
|
$namespaceURI => {null}, |
4229 |
|
|
$localName => 'type', |
4230 |
|
|
$r => $r, |
4231 |
|
|
$defaultValue => {null}, |
4232 |
|
|
}__; |
4233 |
wakaba |
1.14 |
|
4234 |
|
|
unless (defined $r) { |
4235 |
|
|
__DEEP{ |
4236 |
|
|
my $rel = $self-><AG::AtomLinkElement.rel>; |
4237 |
|
|
if (defined $rel and $rel eq <Q::rel|replies>) { |
4238 |
|
|
$r = q<application/atom+xml>; |
4239 |
|
|
} |
4240 |
|
|
}__; |
4241 |
|
|
} |
4242 |
wakaba |
1.1 |
@@Set: |
4243 |
|
|
@@@nullCase: |
4244 |
|
|
@@@@enDesc: |
4245 |
|
|
Removes the attribute. |
4246 |
|
|
@@@NodeReadOnlyError: |
4247 |
|
|
@@@PerlDef: |
4248 |
|
|
__CODE{setReflectAttrStringValue:: |
4249 |
|
|
$node => $self, |
4250 |
|
|
$namespaceURI => {null}, |
4251 |
|
|
$localName => 'type', |
4252 |
|
|
$given => $given, |
4253 |
|
|
}__; |
4254 |
|
|
|
4255 |
wakaba |
1.14 |
@@Test: |
4256 |
|
|
@@@QName: AtomLinkElement.type.!rel.test |
4257 |
|
|
@@@PerlDef: |
4258 |
|
|
my $doc; |
4259 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
4260 |
|
|
|
4261 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'link'); |
4262 |
|
|
|
4263 |
|
|
$test->id ('implied'); |
4264 |
|
|
my $type0 = $el-><AG::AtomLinkElement.type>; |
4265 |
|
|
$test->assert_null ($type0); |
4266 |
|
|
|
4267 |
|
|
$test->id ('explicit'); |
4268 |
|
|
$el-><AS::AtomLinkElement.type> ('application/atom+xml'); |
4269 |
|
|
my $type1 = $el-><AG::AtomLinkElement.type>; |
4270 |
|
|
$test->assert_equals ($type1, q<application/atom+xml>); |
4271 |
|
|
|
4272 |
|
|
$test->id ('different'); |
4273 |
|
|
$el-><AS::AtomLinkElement.type> ('application/xhtml+xml'); |
4274 |
|
|
my $type2 = $el-><AG::AtomLinkElement.type>; |
4275 |
|
|
$test->assert_equals ($type2, q<application/xhtml+xml>); |
4276 |
|
|
@@Test: |
4277 |
|
|
@@@QName: AtomLinkElement.type.rel!=replies.test |
4278 |
|
|
@@@PerlDef: |
4279 |
|
|
my $doc; |
4280 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
4281 |
|
|
|
4282 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'link'); |
4283 |
|
|
|
4284 |
|
|
$el-><AS::AtomLinkElement.rel> (<Q::rel|alternate>); |
4285 |
|
|
|
4286 |
|
|
$test->id ('implied'); |
4287 |
|
|
my $type0 = $el-><AG::AtomLinkElement.type>; |
4288 |
|
|
$test->assert_null ($type0); |
4289 |
|
|
|
4290 |
|
|
$test->id ('explicit'); |
4291 |
|
|
$el-><AS::AtomLinkElement.type> ('application/atom+xml'); |
4292 |
|
|
my $type1 = $el-><AG::AtomLinkElement.type>; |
4293 |
|
|
$test->assert_equals ($type1, q<application/atom+xml>); |
4294 |
|
|
|
4295 |
|
|
$test->id ('different'); |
4296 |
|
|
$el-><AS::AtomLinkElement.type> ('application/xhtml+xml'); |
4297 |
|
|
my $type2 = $el-><AG::AtomLinkElement.type>; |
4298 |
|
|
$test->assert_equals ($type2, q<application/xhtml+xml>); |
4299 |
|
|
@@Test: |
4300 |
|
|
@@@QName: AtomLinkElement.type.rel=replies.test |
4301 |
|
|
@@@PerlDef: |
4302 |
|
|
my $doc; |
4303 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
4304 |
|
|
|
4305 |
|
|
my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'link'); |
4306 |
|
|
|
4307 |
|
|
$el-><AS::AtomLinkElement.rel> (<Q::rel|replies>); |
4308 |
|
|
|
4309 |
|
|
$test->id ('implied'); |
4310 |
|
|
my $type0 = $el-><AG::AtomLinkElement.type>; |
4311 |
|
|
$test->assert_equals ($type0, q<application/atom+xml>); |
4312 |
|
|
|
4313 |
|
|
$test->id ('explicit'); |
4314 |
|
|
$el-><AS::AtomLinkElement.type> ('application/atom+xml'); |
4315 |
|
|
my $type1 = $el-><AG::AtomLinkElement.type>; |
4316 |
|
|
$test->assert_equals ($type1, q<application/atom+xml>); |
4317 |
|
|
|
4318 |
|
|
$test->id ('different'); |
4319 |
|
|
$el-><AS::AtomLinkElement.type> ('application/xhtml+xml'); |
4320 |
|
|
my $type2 = $el-><AG::AtomLinkElement.type>; |
4321 |
|
|
$test->assert_equals ($type2, q<application/xhtml+xml>); |
4322 |
|
|
|
4323 |
wakaba |
1.6 |
@ATTR: |
4324 |
wakaba |
1.1 |
@@Name: hreflang |
4325 |
|
|
@@enDesc: |
4326 |
|
|
The <XA::hreflang> attribute of the element. |
4327 |
|
|
|
4328 |
|
|
It <kwd:MUST> <I::reflect the string value |
4329 |
|
|
of the <XA::hreflang> attribute> of the node. |
4330 |
|
|
@@Type: DOMString |
4331 |
|
|
@@Get: |
4332 |
|
|
@@@nullCase: |
4333 |
|
|
@@@@enDesc: |
4334 |
|
|
If the algorithm returns <DOM::null>. |
4335 |
|
|
@@@PerlDef: |
4336 |
|
|
__CODE{getReflectAttrStringValue:: |
4337 |
|
|
$node => $self, |
4338 |
|
|
$namespaceURI => {null}, |
4339 |
|
|
$localName => 'hreflang', |
4340 |
|
|
$r => $r, |
4341 |
|
|
$defaultValue => {null}, |
4342 |
|
|
}__; |
4343 |
|
|
@@Set: |
4344 |
|
|
@@@nullCase: |
4345 |
|
|
@@@@enDesc: |
4346 |
|
|
Removes the attribute. |
4347 |
|
|
@@@NodeReadOnlyError: |
4348 |
|
|
@@@PerlDef: |
4349 |
|
|
__CODE{setReflectAttrStringValue:: |
4350 |
|
|
$node => $self, |
4351 |
|
|
$namespaceURI => {null}, |
4352 |
|
|
$localName => 'hreflang', |
4353 |
|
|
$given => $given, |
4354 |
|
|
}__; |
4355 |
|
|
|
4356 |
wakaba |
1.6 |
@ATTR: |
4357 |
wakaba |
1.1 |
@@Name: title |
4358 |
|
|
@@enDesc: |
4359 |
|
|
The <XA::title> attribute of the element. |
4360 |
|
|
|
4361 |
|
|
It <kwd:MUST> <I::reflect the string value |
4362 |
|
|
of the <XA::title> attribute> of the node. |
4363 |
|
|
@@Type: DOMString |
4364 |
|
|
@@Get: |
4365 |
|
|
@@@nullCase: |
4366 |
|
|
@@@@enDesc: |
4367 |
|
|
If the algorithm returns <DOM::null>. |
4368 |
|
|
@@@PerlDef: |
4369 |
|
|
__CODE{getReflectAttrStringValue:: |
4370 |
|
|
$node => $self, |
4371 |
|
|
$namespaceURI => {null}, |
4372 |
|
|
$localName => 'title', |
4373 |
|
|
$r => $r, |
4374 |
|
|
$defaultValue => {null}, |
4375 |
|
|
}__; |
4376 |
|
|
@@Set: |
4377 |
|
|
@@@nullCase: |
4378 |
|
|
@@@@enDesc: |
4379 |
|
|
Removes the attribute. |
4380 |
|
|
@@@NodeReadOnlyError: |
4381 |
|
|
@@@PerlDef: |
4382 |
|
|
__CODE{setReflectAttrStringValue:: |
4383 |
|
|
$node => $self, |
4384 |
|
|
$namespaceURI => {null}, |
4385 |
|
|
$localName => 'title', |
4386 |
|
|
$given => $given, |
4387 |
|
|
}__; |
4388 |
|
|
|
4389 |
wakaba |
1.6 |
@ATTR: |
4390 |
wakaba |
1.1 |
@@Name: length |
4391 |
|
|
@@enDesc: |
4392 |
|
|
The <XA::length> attribute of the element. |
4393 |
|
|
|
4394 |
|
|
It <kwd:MUST> <I::reflect the string value |
4395 |
|
|
of the <XA::length> attribute> of the node. |
4396 |
|
|
@@Type: DOMString |
4397 |
|
|
@@Get: |
4398 |
|
|
@@@nullCase: |
4399 |
|
|
@@@@enDesc: |
4400 |
|
|
If the algorithm returns <DOM::null>. |
4401 |
|
|
@@@PerlDef: |
4402 |
|
|
__CODE{getReflectAttrStringValue:: |
4403 |
|
|
$node => $self, |
4404 |
|
|
$namespaceURI => {null}, |
4405 |
|
|
$localName => 'length', |
4406 |
|
|
$r => $r, |
4407 |
|
|
$defaultValue => {null}, |
4408 |
|
|
}__; |
4409 |
|
|
@@Set: |
4410 |
|
|
@@@nullCase: |
4411 |
|
|
@@@@enDesc: |
4412 |
|
|
Removes the attribute. |
4413 |
|
|
@@@NodeReadOnlyError: |
4414 |
|
|
@@@PerlDef: |
4415 |
|
|
__CODE{setReflectAttrStringValue:: |
4416 |
|
|
$node => $self, |
4417 |
|
|
$namespaceURI => {null}, |
4418 |
|
|
$localName => 'length', |
4419 |
|
|
$given => $given, |
4420 |
|
|
}__; |
4421 |
|
|
##AtomLinkElement |
4422 |
|
|
|
4423 |
|
|
IFClsETDef: |
4424 |
|
|
@IFQName: AtomPublishedElement |
4425 |
|
|
@ETQName: atom|published |
4426 |
wakaba |
1.6 |
@ETRQName: atom|published |
4427 |
wakaba |
1.1 |
@ClsQName: ManakaiAtomPublishedElement |
4428 |
|
|
|
4429 |
|
|
@IFISA: AtomDateConstruct |
4430 |
|
|
@ClsISA: ManakaiAtomDateConstruct |
4431 |
wakaba |
1.14 |
|
4432 |
|
|
@f:implements: AtomFeature10 |
4433 |
wakaba |
1.8 |
@mv:refers: DateAG |
4434 |
wakaba |
1.7 |
@mv:elementContentModel: DateCM |
4435 |
wakaba |
1.1 |
|
4436 |
|
|
@enDesc: |
4437 |
|
|
The <XE::atom|published> element is a Date construct |
4438 |
|
|
indicating an instant in time associated with an |
4439 |
|
|
event early in the life cycle of the entry. |
4440 |
|
|
|
4441 |
|
|
Typically, <XE::atom|published> will be associated with |
4442 |
|
|
the initial creation or first availability of the resouce. |
4443 |
|
|
##AtomPublishedElement |
4444 |
|
|
|
4445 |
|
|
IFClsETDef: |
4446 |
|
|
@IFQName: AtomRightsElement |
4447 |
|
|
@ETQName: atom|rights |
4448 |
wakaba |
1.6 |
@ETRQName: atom|rights |
4449 |
wakaba |
1.1 |
@ClsQName: ManakaiAtomRightsElement |
4450 |
|
|
|
4451 |
|
|
@IFISA: AtomTextConstruct |
4452 |
|
|
@ClsISA: ManakaiAtomTextConstruct |
4453 |
wakaba |
1.14 |
|
4454 |
|
|
@f:implements: AtomFeature10 |
4455 |
wakaba |
1.8 |
@mv:refers: TextAG |
4456 |
wakaba |
1.7 |
@mv:elementContentModel: TextCM |
4457 |
wakaba |
1.1 |
|
4458 |
|
|
@enDesc: |
4459 |
|
|
The <XE::atom|rights> element is a Text construct |
4460 |
|
|
that conveys information about rights held in and |
4461 |
|
|
over an entry or feed. |
4462 |
|
|
##AtomRightsElement |
4463 |
|
|
|
4464 |
wakaba |
1.8 |
ECDef: |
4465 |
|
|
@QName: source-prop |
4466 |
|
|
@mv:elementTypeClassName: source-prop |
4467 |
|
|
@mv:refers: atom|author |
4468 |
|
|
@mv:refers: atom|category |
4469 |
|
|
@mv:refers: atom|contributor |
4470 |
|
|
@mv:refers: atom|generator |
4471 |
|
|
@mv:refers: atom|icon |
4472 |
|
|
@mv:refers: atom|id |
4473 |
|
|
@mv:refers: atom|link |
4474 |
|
|
@mv:refers: atom|logo |
4475 |
|
|
@mv:refers: atom|rights |
4476 |
|
|
@mv:refers: atom|subtitle |
4477 |
|
|
@mv:refers: atom|title |
4478 |
|
|
@mv:refers: atom|updated |
4479 |
|
|
@mv:refers: extensionElements |
4480 |
|
|
|
4481 |
wakaba |
1.1 |
IFClsETDef: |
4482 |
|
|
@IFQName: AtomSourceElement |
4483 |
|
|
@ETQName: atom|source |
4484 |
wakaba |
1.6 |
@ETRQName: atom|source |
4485 |
wakaba |
1.1 |
@ClsQName: ManakaiAtomSourceElement |
4486 |
|
|
|
4487 |
|
|
@IFISA: AtomElement |
4488 |
|
|
@ClsISA: ManakaiAtomElement |
4489 |
wakaba |
1.10 |
|
4490 |
wakaba |
1.14 |
@f:implements: AtomFeature10 |
4491 |
wakaba |
1.10 |
@mv:refers: atomCommonAttributes |
4492 |
wakaba |
1.1 |
|
4493 |
wakaba |
1.9 |
@cm: |
4494 |
|
|
(source-prop*) |
4495 |
|
|
|
4496 |
wakaba |
1.1 |
@Attr: |
4497 |
|
|
@@Name: authorElements |
4498 |
|
|
@@enDesc: |
4499 |
|
|
A static list of <XE::atom|author> child elements of the node. |
4500 |
|
|
@@Type: StaticNodeList |
4501 |
|
|
@@Get: |
4502 |
|
|
@@@enDesc: |
4503 |
|
|
It <kwd:MUST> <I::return a <XE::atom|author> child element list> |
4504 |
|
|
of the node. |
4505 |
|
|
@@@disDef: |
4506 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.authorElements.get |
4507 |
|
|
|
4508 |
|
|
@Attr: |
4509 |
|
|
@@Name: categoryElements |
4510 |
|
|
@@enDesc: |
4511 |
|
|
A static list of <XE::atom|category> child elements of the node. |
4512 |
|
|
@@Type: StaticNodeList |
4513 |
|
|
@@Get: |
4514 |
|
|
@@@enDesc: |
4515 |
|
|
It <kwd:MUST> <I::return a <XE::atom|category> child element list> |
4516 |
|
|
of the node. |
4517 |
|
|
@@@disDef: |
4518 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.categoryElements.get |
4519 |
|
|
|
4520 |
|
|
@Attr: |
4521 |
|
|
@@Name: contributorElements |
4522 |
|
|
@@enDesc: |
4523 |
|
|
A static list of <XE::atom|contributor> child elements of the node. |
4524 |
|
|
@@Type: StaticNodeList |
4525 |
|
|
@@Get: |
4526 |
|
|
@@@enDesc: |
4527 |
|
|
It <kwd:MUST> <I::return a <XE::atom|contributor> child element list> |
4528 |
|
|
of the node. |
4529 |
|
|
@@@disDef: |
4530 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.contributorElements.get |
4531 |
|
|
|
4532 |
|
|
@Attr: |
4533 |
|
|
@@Name: generatorElement |
4534 |
|
|
@@enDesc: |
4535 |
|
|
The <XE::atom|generator> child element of the node. |
4536 |
|
|
@@Type: AtomGeneratorElement |
4537 |
|
|
@@Get: |
4538 |
|
|
@@@enDesc: |
4539 |
|
|
It <kwd:MUST> <I::return a <XE::atom|generator> child element> |
4540 |
|
|
of the node. |
4541 |
|
|
@@@nullCase: |
4542 |
|
|
@@@@enDesc: |
4543 |
|
|
If the algorithm returns <DOM::null>. |
4544 |
|
|
@@@NodeReadOnlyError: |
4545 |
|
|
@@@disDef: |
4546 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.generatorElement.get |
4547 |
|
|
|
4548 |
|
|
@Attr: |
4549 |
|
|
@@Name: icon |
4550 |
|
|
@@enDesc: |
4551 |
|
|
The <XE::atom|icon> value of the node. |
4552 |
|
|
|
4553 |
|
|
It <kwd:MUST> <I::reflect the URI value |
4554 |
|
|
of the <XE::atom|icon> child element> of the node. |
4555 |
|
|
@@Type: DOMString |
4556 |
|
|
@@actualType: DOMURI |
4557 |
|
|
@@Get: |
4558 |
|
|
@@@nullCase: |
4559 |
|
|
@@@@enDesc: |
4560 |
|
|
If the algorithm returns <DOM::null>. |
4561 |
|
|
@@@NodeReadOnlyError: |
4562 |
|
|
@@@disDef: |
4563 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.icon.get |
4564 |
|
|
@@Set: |
4565 |
|
|
@@@nullCase: |
4566 |
|
|
@@@@enDesc: |
4567 |
|
|
Removes the value. |
4568 |
|
|
@@@NodeReadOnlyError: |
4569 |
|
|
@@@disDef: |
4570 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.icon.set |
4571 |
|
|
|
4572 |
|
|
@Attr: |
4573 |
|
|
@@Name: id |
4574 |
|
|
@@enDesc: |
4575 |
|
|
The <XE::atom|id> value of the node. |
4576 |
|
|
|
4577 |
|
|
It <kwd:MUST> <I::reflect the string value |
4578 |
|
|
of the <XE::atom|id> child element> of the node. |
4579 |
|
|
@@Type: DOMString |
4580 |
|
|
@@actualType: DOMURI |
4581 |
|
|
@@Get: |
4582 |
|
|
@@@nullCase: |
4583 |
|
|
@@@@enDesc: |
4584 |
|
|
If the algorithm returns <DOM::null>. |
4585 |
|
|
@@@NodeReadOnlyError: |
4586 |
|
|
@@@disDef: |
4587 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.id.get |
4588 |
|
|
@@Set: |
4589 |
|
|
@@@nullCase: |
4590 |
|
|
@@@@enDesc: |
4591 |
|
|
Removes the value. |
4592 |
|
|
@@@NodeReadOnlyError: |
4593 |
|
|
@@@disDef: |
4594 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.id.set |
4595 |
|
|
|
4596 |
|
|
@Attr: |
4597 |
|
|
@@Name: linkElements |
4598 |
|
|
@@enDesc: |
4599 |
|
|
A static list of <XE::atom|link> child elements of the node. |
4600 |
|
|
@@Type: StaticNodeList |
4601 |
|
|
@@Get: |
4602 |
|
|
@@@enDesc: |
4603 |
|
|
It <kwd:MUST> <I::return a <XE::atom|link> child element list> |
4604 |
|
|
of the node. |
4605 |
|
|
@@@disDef: |
4606 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.linkElements.get |
4607 |
|
|
|
4608 |
|
|
@Attr: |
4609 |
|
|
@@Name: logo |
4610 |
|
|
@@enDesc: |
4611 |
|
|
The <XE::atom|logo> value of the node. |
4612 |
|
|
|
4613 |
|
|
It <kwd:MUST> <I::reflect the URI value |
4614 |
|
|
of the <XE::atom|logo> child element> of the node. |
4615 |
|
|
@@Type: DOMString |
4616 |
|
|
@@actualType: DOMURI |
4617 |
|
|
@@Get: |
4618 |
|
|
@@@nullCase: |
4619 |
|
|
@@@@enDesc: |
4620 |
|
|
If the algorithm returns <DOM::null>. |
4621 |
|
|
@@@NodeReadOnlyError: |
4622 |
|
|
@@@disDef: |
4623 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.logo.get |
4624 |
|
|
@@Set: |
4625 |
|
|
@@@nullCase: |
4626 |
|
|
@@@@enDesc: |
4627 |
|
|
Removes the value. |
4628 |
|
|
@@@NodeReadOnlyError: |
4629 |
|
|
@@@disDef: |
4630 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.logo.set |
4631 |
|
|
|
4632 |
|
|
@Attr: |
4633 |
|
|
@@Name: rightsElement |
4634 |
|
|
@@enDesc: |
4635 |
|
|
The <XE::atom|rights> child element of the node. |
4636 |
|
|
@@Type: AtomRightsElement |
4637 |
|
|
@@Get: |
4638 |
|
|
@@@enDesc: |
4639 |
|
|
It <kwd:MUST> <I::return a <XE::atom|rights> child element> |
4640 |
|
|
of the node. |
4641 |
|
|
@@@nullCase: |
4642 |
|
|
@@@@enDesc: |
4643 |
|
|
If the algorithm returns <DOM::null>. |
4644 |
|
|
@@@NodeReadOnlyError: |
4645 |
|
|
@@@disDef: |
4646 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.rightsElement.get |
4647 |
|
|
|
4648 |
|
|
@Attr: |
4649 |
|
|
@@Name: subtitleElement |
4650 |
|
|
@@enDesc: |
4651 |
|
|
The <XE::atom|subtitle> child element of the node. |
4652 |
|
|
@@Type: AtomSubtitleElement |
4653 |
|
|
@@Get: |
4654 |
|
|
@@@enDesc: |
4655 |
|
|
It <kwd:MUST> <I::return a <XE::atom|subtitle> child element> |
4656 |
|
|
of the node. |
4657 |
|
|
@@@nullCase: |
4658 |
|
|
@@@@enDesc: |
4659 |
|
|
If the algorithm returns <DOM::null>. |
4660 |
|
|
@@@NodeReadOnlyError: |
4661 |
|
|
@@@disDef: |
4662 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.subtitleElement.get |
4663 |
|
|
|
4664 |
|
|
@Attr: |
4665 |
|
|
@@Name: titleElement |
4666 |
|
|
@@enDesc: |
4667 |
|
|
The <XE::atom|title> child element of the node. |
4668 |
|
|
@@Type: AtomTitleElement |
4669 |
|
|
@@Get: |
4670 |
|
|
@@@enDesc: |
4671 |
|
|
It <kwd:MUST> <I::return a <XE::atom|title> child element> |
4672 |
|
|
of the node. |
4673 |
|
|
@@@nullCase: |
4674 |
|
|
@@@@enDesc: |
4675 |
|
|
If the algorithm returns <DOM::null>. |
4676 |
|
|
@@@NodeReadOnlyError: |
4677 |
|
|
@@@disDef: |
4678 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.titleElement.get |
4679 |
|
|
|
4680 |
|
|
@Attr: |
4681 |
|
|
@@Name: updatedElement |
4682 |
|
|
@@enDesc: |
4683 |
|
|
The <XE::atom|updated> child element of the node. |
4684 |
|
|
@@Type: AtomUpdatedElement |
4685 |
|
|
@@Get: |
4686 |
|
|
@@@enDesc: |
4687 |
|
|
It <kwd:MUST> <I::return a <XE::atom|updated> child element> |
4688 |
|
|
of the node. |
4689 |
|
|
@@@nullCase: |
4690 |
|
|
@@@@enDesc: |
4691 |
|
|
If the algorithm returns <DOM::null>. |
4692 |
|
|
@@@NodeReadOnlyError: |
4693 |
|
|
@@@disDef: |
4694 |
|
|
@@@@dlp:cloneCode: ManakaiAtomFeedElement.updatedElement.get |
4695 |
|
|
##AtomSourceElement |
4696 |
|
|
|
4697 |
|
|
IFClsETDef: |
4698 |
|
|
@IFQName: AtomSubtitleElement |
4699 |
|
|
@ETQName: atom|subtitle |
4700 |
wakaba |
1.6 |
@ETRQName: atom|subtitle |
4701 |
wakaba |
1.1 |
@ClsQName: ManakaiAtomSubtitleElement |
4702 |
|
|
|
4703 |
|
|
@IFISA: AtomTextConstruct |
4704 |
|
|
@ClsISA: ManakaiAtomTextConstruct |
4705 |
wakaba |
1.14 |
|
4706 |
|
|
@f:implements: AtomFeature10 |
4707 |
wakaba |
1.8 |
@mv:refers: TextAG |
4708 |
wakaba |
1.7 |
@mv:elementContentModel: TextCM |
4709 |
wakaba |
1.1 |
|
4710 |
|
|
@enDesc: |
4711 |
|
|
The <XE::atom|subtitle> element is a Text construct |
4712 |
|
|
that conveys a human-readable description or subtitle for a feed. |
4713 |
|
|
##AtomSubtitleElement |
4714 |
|
|
|
4715 |
|
|
IFClsETDef: |
4716 |
|
|
@IFQName: AtomSummaryElement |
4717 |
|
|
@ETQName: atom|summary |
4718 |
wakaba |
1.6 |
@ETRQName: atom|summary |
4719 |
wakaba |
1.1 |
@ClsQName: ManakaiAtomSummaryElement |
4720 |
|
|
|
4721 |
|
|
@IFISA: AtomTextConstruct |
4722 |
|
|
@ClsISA: ManakaiAtomTextConstruct |
4723 |
wakaba |
1.14 |
|
4724 |
|
|
@f:implements: AtomFeature10 |
4725 |
wakaba |
1.8 |
@mv:refers: TextAG |
4726 |
wakaba |
1.7 |
@mv:elementContentModel: TextCM |
4727 |
wakaba |
1.1 |
|
4728 |
|
|
@enDesc: |
4729 |
|
|
The <XE::atom|summary> element is a Text construct |
4730 |
|
|
that conveys a short summary, abstract, or excerpt of an entry. |
4731 |
|
|
##AtomSummaryElement |
4732 |
|
|
|
4733 |
|
|
IFClsETDef: |
4734 |
|
|
@IFQName: AtomTitleElement |
4735 |
|
|
@ETQName: atom|title |
4736 |
wakaba |
1.6 |
@ETRQName: atom|title |
4737 |
wakaba |
1.1 |
@ClsQName: ManakaiAtomTitleElement |
4738 |
|
|
|
4739 |
|
|
@IFISA: AtomTextConstruct |
4740 |
|
|
@ClsISA: ManakaiAtomTextConstruct |
4741 |
wakaba |
1.14 |
|
4742 |
|
|
@f:implements: AtomFeature10 |
4743 |
wakaba |
1.8 |
@mv:refers: TextAG |
4744 |
wakaba |
1.7 |
@mv:elementContentModel: TextCM |
4745 |
wakaba |
1.1 |
|
4746 |
|
|
@enDesc: |
4747 |
|
|
The <XE::atom|title> element is a Text construct |
4748 |
|
|
that conveys a human-readable title for an entry or feed. |
4749 |
|
|
##AtomTitleElement |
4750 |
|
|
|
4751 |
|
|
IFClsETDef: |
4752 |
|
|
@IFQName: AtomUpdatedElement |
4753 |
|
|
@ETQName: atom|updated |
4754 |
wakaba |
1.6 |
@ETRQName: atom|updated |
4755 |
wakaba |
1.1 |
@ClsQName: ManakaiAtomUpdatedElement |
4756 |
|
|
|
4757 |
|
|
@IFISA: AtomDateConstruct |
4758 |
|
|
@ClsISA: ManakaiAtomDateConstruct |
4759 |
wakaba |
1.14 |
|
4760 |
|
|
@f:implements: AtomFeature10 |
4761 |
wakaba |
1.8 |
@mv:refers: DateAG |
4762 |
wakaba |
1.7 |
@mv:elementContentModel: DateCM |
4763 |
wakaba |
1.1 |
|
4764 |
|
|
@enDesc: |
4765 |
|
|
The <XE::atom|updated> element is a Date construct |
4766 |
|
|
indicating the most recent instant in time when an |
4767 |
|
|
entry or feed was modified in a way the publisher considers |
4768 |
|
|
significant. |
4769 |
|
|
##AtomPublishedElement |
4770 |
|
|
|
4771 |
|
|
ElementTypeBinding: |
4772 |
|
|
@Name: NodeReadOnlyError |
4773 |
|
|
@ElementType: |
4774 |
|
|
dx:raises |
4775 |
|
|
@ShadowContent: |
4776 |
|
|
@@@: MDOMX|NOMOD_THIS |
4777 |
|
|
@@Description: |
4778 |
|
|
@@@lang:en |
4779 |
|
|
@@@@: |
4780 |
|
|
If the node or a descendant of it, which |
4781 |
|
|
is to be modified, is read-only. |
4782 |
|
|
|
4783 |
|
|
## -- Configuration Parameters |
4784 |
|
|
|
4785 |
|
|
boolCParam: |
4786 |
|
|
@QName: cfg|create-child-element |
4787 |
|
|
@tc:nodeStemKey: |
4788 |
|
|
@@@: ccldel |
4789 |
|
|
@@ForCheck: =ManakaiDOM|all |
4790 |
|
|
@c:targetType: tc|Document |
4791 |
|
|
@IsSupportRequired:1 |
4792 |
|
|
@TrueCase: |
4793 |
|
|
@@c:isSupported:1 |
4794 |
|
|
@@enDesc: |
4795 |
|
|
If the parameter is set to <DOM::true>, some DOM attributes |
4796 |
|
|
that returns an element will create a child element |
4797 |
|
|
when there is no element that met the condition defined |
4798 |
|
|
for that DOM attribute. |
4799 |
|
|
@FalseCase: |
4800 |
|
|
@@c:isSupported:1 |
4801 |
|
|
@@IsSupportRequired:1 |
4802 |
|
|
@@IsDefault:1 |
4803 |
|
|
@@enDesc: |
4804 |
|
|
If the parameter is set to <DOM::true>, some DOM attributes |
4805 |
|
|
that returns an element will <EM::not> create a child element |
4806 |
|
|
even when there is no element that met the condition defined |
4807 |
|
|
for that DOM attribute. |
4808 |
|
|
@TestC: |
4809 |
|
|
@@QName: cfg.create-child-element.set.test |
4810 |
|
|
@@PerlCDef: |
4811 |
|
|
my $doc; |
4812 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
4813 |
|
|
|
4814 |
|
|
my $cfg = $doc-><AG::Document.domConfig>; |
4815 |
|
|
my $cp = <Q::cfg|create-child-element>; |
4816 |
|
|
|
4817 |
|
|
$test->id ('default'); |
4818 |
|
|
$test->assert_false ($cfg-><M::CFG.getParameter> ($cp)); |
4819 |
|
|
|
4820 |
|
|
$test->id ('set.f.to.t'); |
4821 |
|
|
$cfg-><M::CFG.setParameter> ($cp => true); |
4822 |
|
|
$test->assert_true ($cfg-><M::CFG.getParameter> ($cp)); |
4823 |
|
|
|
4824 |
|
|
$test->id ('set.t.to.f'); |
4825 |
|
|
$cfg-><M::CFG.setParameter> ($cp => false); |
4826 |
|
|
$test->assert_false ($cfg-><M::CFG.getParameter> ($cp)); |
4827 |
|
|
|
4828 |
|
|
$cfg-><M::CFG.setParameter> ($cp => true); |
4829 |
|
|
|
4830 |
|
|
$test->id ('reset'); |
4831 |
|
|
$cfg-><M::CFG.setParameter> ($cp => null); |
4832 |
|
|
$test->assert_false ($cfg-><M::CFG.getParameter> ($cp)); |
4833 |
|
|
|
4834 |
|
|
ResourceDef: |
4835 |
|
|
@QName: CFG |
4836 |
|
|
@AliasFor: c|DOMConfiguration |
4837 |
|
|
@For: ManakaiDOM|DOM3 |
4838 |
|
|
|
4839 |
|
|
ElementTypeBinding: |
4840 |
|
|
@Name: boolCParam |
4841 |
|
|
@ElementType: |
4842 |
|
|
dis:ResourceDef |
4843 |
|
|
@ShadowContent: |
4844 |
|
|
@@DISCore:resourceType: |
4845 |
|
|
@@@@: c|DOMConfigurationParameter |
4846 |
|
|
@@@For: ManakaiDOM|DOM |
4847 |
|
|
@@DISCore:resourceType: |
4848 |
|
|
@@@@: DISCore|Property |
4849 |
|
|
@@@For: =ManakaiDOM|all |
4850 |
|
|
@@For: ManakaiDOM|DOM3 |
4851 |
|
|
@@For: =ManakaiDOM|all |
4852 |
|
|
@@Type: idl|boolean||ManakaiDOM|all |
4853 |
wakaba |
1.8 |
|
4854 |
|
|
ECDef: |
4855 |
|
|
@QName: simpleExtensionElements |
4856 |
|
|
@mv:elementTypeClassName: simple.extra |
4857 |
|
|
@DISCore:resourceType: mv|ElementTypeAdditionalClass |
4858 |
|
|
|
4859 |
|
|
ECDef: |
4860 |
|
|
@QName: structuredExtensionElements |
4861 |
|
|
@mv:elementTypeClassName: structured.extra |
4862 |
|
|
@DISCore:resourceType: mv|ElementTypeAdditionalClass |
4863 |
|
|
|
4864 |
|
|
EMDef: |
4865 |
|
|
@QName: extensionElements |
4866 |
|
|
@mv:elementTypeClassName: extra |
4867 |
|
|
@mv:refers: simpleExtensionElements |
4868 |
|
|
@mv:refers: structuredExtensionElements |
4869 |
|
|
@DISCore:resourceType: mv|ElementTypeAdditionalClass |
4870 |
|
|
|
4871 |
|
|
AGDef: |
4872 |
|
|
@QName: undefinedAttributes |
4873 |
|
|
@mv:attributeTypeGroupName: common.extra |
4874 |
|
|
|
4875 |
wakaba |
1.9 |
ResourceDef: |
4876 |
|
|
@QName: undefinedContent |
4877 |
|
|
@mv:elementContentModelName: undefined |
4878 |
|
|
@For: =ManakaiDOM|ManakaiDOMLatest |
4879 |
|
|
@DISCore:resourceType: mv|ElementContentModel |
4880 |
|
|
@cm: dxm|ANY||ManakaiDOM|all |
4881 |
|
|
@enImplNote: |
4882 |
|
|
(text | anyForeignElement)* |
4883 |
wakaba |
1.14 |
|
4884 |
|
|
## -- Atom Threading Extension [RFC 4685] |
4885 |
|
|
|
4886 |
|
|
IFClsDef: |
4887 |
|
|
@IFQName: AtomEntryElementThread |
4888 |
|
|
@ClsQName: ManakaiAtomEntryElementThread |
4889 |
|
|
|
4890 |
|
|
@ClsISA: ManakaiAtomEntryElement |
4891 |
|
|
|
4892 |
|
|
@f:implements: AtomThreadingFeature10 |
4893 |
|
|
|
4894 |
|
|
@enDesc: |
4895 |
|
|
If the feature <Feature^^DISCore|QName::AtomThreadingFeature10> |
4896 |
|
|
is supported, any <IF::Element> whose element type |
4897 |
|
|
is <XE::atom|entry> <kwd:MUST> implement the <IF::AtomEntryElementThread> |
4898 |
|
|
interface in addition to other appropriate interfaces. |
4899 |
|
|
|
4900 |
|
|
@Test: |
4901 |
|
|
@@QName: AtomEntryElementThread.1.test |
4902 |
|
|
@@PerlDef: |
4903 |
|
|
my $doc; |
4904 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
4905 |
|
|
|
4906 |
|
|
my $el = $doc->create_element_ns (<Q::atom|>, 'entry'); |
4907 |
|
|
|
4908 |
|
|
$test->id ('interface'); |
4909 |
|
|
$test->assert_isa ($el, <IFName::AtomEntryElementThread>); |
4910 |
|
|
|
4911 |
|
|
$test->id ('feature'); |
4912 |
|
|
$test->assert_true ($el->is_supported (<Q::fe|AtomThreading> => '1.0')); |
4913 |
|
|
|
4914 |
|
|
@Attr: |
4915 |
|
|
@@Name: threadInReplyToElements |
4916 |
|
|
@@enDesc: |
4917 |
|
|
A static list of <XE::thr|in-reply-to> child elements of the node. |
4918 |
|
|
@@Type: StaticNodeList |
4919 |
|
|
@@Get: |
4920 |
|
|
@@@enDesc: |
4921 |
|
|
It <kwd:MUST> <I::return a <XE::thr|in-reply-to> child element list> |
4922 |
|
|
of the node. |
4923 |
|
|
@@@PerlDef: |
4924 |
|
|
__CODE{returnChildElementList:: |
4925 |
|
|
$node => $self, |
4926 |
|
|
$namespaceURI => {<Q::thr|>}, |
4927 |
|
|
$localName => 'in-reply-to', |
4928 |
|
|
$r => $r, |
4929 |
|
|
}__; |
4930 |
|
|
##AtomEntryElementThread |
4931 |
|
|
|
4932 |
|
|
IFClsETDef: |
4933 |
|
|
@IFQName: AtomThreadInReplyToElement |
4934 |
|
|
@ETQName: thr|in-reply-to |
4935 |
|
|
@ETRQName: thr|in-reply-to |
4936 |
|
|
@ClsQName: ManakaiAtomThreadInReplyToElement |
4937 |
|
|
|
4938 |
|
|
@IFISA: AtomDateConstruct |
4939 |
|
|
@ClsISA: ManakaiAtomDateConstruct |
4940 |
|
|
|
4941 |
|
|
@f:implements: AtomThreadingFeature10 |
4942 |
|
|
@mv:refers: atomCommonAttributes |
4943 |
|
|
|
4944 |
|
|
@cm: undefinedContent |
4945 |
|
|
|
4946 |
|
|
@enDesc: |
4947 |
|
|
The <XE::thr|in-reply-to> element is used to indicate |
4948 |
|
|
that an entry is a response to another resource. |
4949 |
|
|
|
4950 |
|
|
If the entry is a response to multiple resources, |
4951 |
|
|
additional <XE::thr|in-reply-to> element <kwd:MAY> |
4952 |
|
|
be used. |
4953 |
|
|
|
4954 |
|
|
RFC 4685 assigns no significance to the order in which |
4955 |
|
|
multiple <XE::thr|in-reply-to> element appear within |
4956 |
|
|
an entry. |
4957 |
|
|
|
4958 |
|
|
@Test: |
4959 |
|
|
@@QName: AtomThreadInReplyToElement.1.test |
4960 |
|
|
@@PerlDef: |
4961 |
|
|
my $doc; |
4962 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
4963 |
|
|
|
4964 |
|
|
my $el = $doc->create_element_ns (<Q::thr|>, 'in-reply-to'); |
4965 |
|
|
|
4966 |
|
|
$test->id ('interface'); |
4967 |
|
|
$test->assert_isa ($el, <IFName::AtomThreadInReplyToElement>); |
4968 |
|
|
|
4969 |
|
|
$test->id ('feature'); |
4970 |
|
|
$test->assert_true ($el->is_supported (<Q::fe|AtomThreading> => '1.0')); |
4971 |
|
|
|
4972 |
|
|
@ATTR: |
4973 |
|
|
@@Name: ref |
4974 |
|
|
@@enDesc: |
4975 |
|
|
The <XA::ref> attribute of the element. |
4976 |
|
|
|
4977 |
|
|
It <kwd:MUST> <I::reflect the URI value |
4978 |
|
|
of the <XA::ref> attribute> of the node. |
4979 |
|
|
|
4980 |
|
|
The <XA::ref> attribute specifies the persistent, |
4981 |
|
|
universally unique identifier of the resource being |
4982 |
|
|
responded to. The value <kwd:MUST> conform to |
4983 |
|
|
the same construction and comparison rules as the |
4984 |
|
|
value of the <XE::atom|id> element. Though the IRI |
4985 |
|
|
might use a dereferenceable scheme, processors <kwd:MUST-NOT> |
4986 |
|
|
assume that it can be dereferenced. |
4987 |
|
|
|
4988 |
|
|
The <XE::thr|in-reply-to> element <kwd:MUST> contain |
4989 |
|
|
a <XA::ref> attribute identifying the resource that |
4990 |
|
|
is being respnoded to. |
4991 |
|
|
|
4992 |
|
|
If the resource being responded to does not have a persistent, |
4993 |
|
|
universally unique identifier, the publisher <kwd:MUST> assign an |
4994 |
|
|
identifier that satisfies all the considerations in Section 4.2.6 of |
4995 |
|
|
RFC 4287 for use as the value of the <XA::ref> attribute. |
4996 |
|
|
In that case, if a representation of the resource can be retrieved |
4997 |
|
|
from an IRI that can be used as a valid atom:id value, then this IRI |
4998 |
|
|
<kwd:SHOULD> be used as the value of both the <XA::ref> and |
4999 |
|
|
<XA::href> attributes. |
5000 |
|
|
@@Type: DOMString |
5001 |
|
|
@@actualType: DOMURI |
5002 |
|
|
@@Get: |
5003 |
|
|
@@@nullCase: |
5004 |
|
|
@@@@enDesc: |
5005 |
|
|
If the algorithm returns <DOM::null>. |
5006 |
|
|
@@@PerlDef: |
5007 |
|
|
__CODE{getReflectAttrURIValue:: |
5008 |
|
|
$node => $self, |
5009 |
|
|
$namespaceURI => {null}, |
5010 |
|
|
$localName => 'ref', |
5011 |
|
|
$r => $r, |
5012 |
|
|
$defaultValue => {null}, |
5013 |
|
|
}__; |
5014 |
|
|
@@Set: |
5015 |
|
|
@@@nullCase: |
5016 |
|
|
@@@@enDesc: |
5017 |
|
|
Removes the attribute. |
5018 |
|
|
@@@NodeReadOnlyError: |
5019 |
|
|
@@@PerlDef: |
5020 |
|
|
__CODE{setReflectAttrURIValue:: |
5021 |
|
|
$node => $self, |
5022 |
|
|
$namespaceURI => {null}, |
5023 |
|
|
$localName => 'ref', |
5024 |
|
|
$given => $given, |
5025 |
|
|
}__; |
5026 |
|
|
|
5027 |
|
|
@ATTR: |
5028 |
|
|
@@Name: source |
5029 |
|
|
@@enDesc: |
5030 |
|
|
The <XA::source> attribute of the element. |
5031 |
|
|
|
5032 |
|
|
It <kwd:MUST> <I::reflect the URI value |
5033 |
|
|
of the <XA::source> attribute> of the node. |
5034 |
|
|
|
5035 |
|
|
The <XA::source> attribute <kwd:MAY> be used to specify the IRI |
5036 |
|
|
of an Atom Feed or Entry Document containing an |
5037 |
|
|
<XE::atom|entry> with an <XE::atom|id> value equal to the |
5038 |
|
|
value of the <XA::ref> attribute. The IRI specified <kwd:MUST> |
5039 |
|
|
be dereferenceable. |
5040 |
|
|
@@Type: DOMString |
5041 |
|
|
@@actualType: DOMURI |
5042 |
|
|
@@Get: |
5043 |
|
|
@@@nullCase: |
5044 |
|
|
@@@@enDesc: |
5045 |
|
|
If the algorithm returns <DOM::null>. |
5046 |
|
|
@@@PerlDef: |
5047 |
|
|
__CODE{getReflectAttrURIValue:: |
5048 |
|
|
$node => $self, |
5049 |
|
|
$namespaceURI => {null}, |
5050 |
|
|
$localName => 'source', |
5051 |
|
|
$r => $r, |
5052 |
|
|
$defaultValue => {null}, |
5053 |
|
|
}__; |
5054 |
|
|
@@Set: |
5055 |
|
|
@@@nullCase: |
5056 |
|
|
@@@@enDesc: |
5057 |
|
|
Removes the attribute. |
5058 |
|
|
@@@NodeReadOnlyError: |
5059 |
|
|
@@@PerlDef: |
5060 |
|
|
__CODE{setReflectAttrURIValue:: |
5061 |
|
|
$node => $self, |
5062 |
|
|
$namespaceURI => {null}, |
5063 |
|
|
$localName => 'source', |
5064 |
|
|
$given => $given, |
5065 |
|
|
}__; |
5066 |
|
|
|
5067 |
|
|
@ATTR: |
5068 |
|
|
@@Name: href |
5069 |
|
|
@@enDesc: |
5070 |
|
|
The <XA::href> attribute of the element. |
5071 |
|
|
|
5072 |
|
|
It <kwd:MUST> <I::reflect the URI value |
5073 |
|
|
of the <XA::href> attribute> of the node. |
5074 |
|
|
|
5075 |
|
|
The <XA::href> attribute specifies an IRI that may be used |
5076 |
|
|
to retrieve a representation of the resource being |
5077 |
|
|
responded to. The IRI specified <kwd:MUST> be |
5078 |
|
|
dereferenceable. |
5079 |
|
|
@@Type: DOMString |
5080 |
|
|
@@actualType: DOMURI |
5081 |
|
|
@@Get: |
5082 |
|
|
@@@nullCase: |
5083 |
|
|
@@@@enDesc: |
5084 |
|
|
If the algorithm returns <DOM::null>. |
5085 |
|
|
@@@PerlDef: |
5086 |
|
|
__CODE{getReflectAttrURIValue:: |
5087 |
|
|
$node => $self, |
5088 |
|
|
$namespaceURI => {null}, |
5089 |
|
|
$localName => 'href', |
5090 |
|
|
$r => $r, |
5091 |
|
|
$defaultValue => {null}, |
5092 |
|
|
}__; |
5093 |
|
|
@@Set: |
5094 |
|
|
@@@nullCase: |
5095 |
|
|
@@@@enDesc: |
5096 |
|
|
Removes the attribute. |
5097 |
|
|
@@@NodeReadOnlyError: |
5098 |
|
|
@@@PerlDef: |
5099 |
|
|
__CODE{setReflectAttrURIValue:: |
5100 |
|
|
$node => $self, |
5101 |
|
|
$namespaceURI => {null}, |
5102 |
|
|
$localName => 'href', |
5103 |
|
|
$given => $given, |
5104 |
|
|
}__; |
5105 |
|
|
|
5106 |
|
|
@ATTR: |
5107 |
|
|
@@Name: type |
5108 |
|
|
@@enDesc: |
5109 |
|
|
The <XA::type> attribute of the element. |
5110 |
|
|
|
5111 |
|
|
It <kwd:MUST> <I::reflect the string value |
5112 |
|
|
of the <XA::type> attribute> of the node. |
5113 |
|
|
|
5114 |
|
|
The <XA::type> attribute <kwd:MAY> be used to provide |
5115 |
|
|
a hint to the client about the media type of the |
5116 |
|
|
resource identified by the <XA::href> attribute. |
5117 |
|
|
The <XA::type> attribute is only meaningful if a |
5118 |
|
|
corresponding <XA::href> attribute is also provided. |
5119 |
|
|
@@Type: DOMString |
5120 |
|
|
@@Get: |
5121 |
|
|
@@@nullCase: |
5122 |
|
|
@@@@enDesc: |
5123 |
|
|
If the algorithm returns <DOM::null>. |
5124 |
|
|
@@@PerlDef: |
5125 |
|
|
__CODE{getReflectAttrStringValue:: |
5126 |
|
|
$node => $self, |
5127 |
|
|
$namespaceURI => {null}, |
5128 |
|
|
$localName => 'type', |
5129 |
|
|
$r => $r, |
5130 |
|
|
$defaultValue => {null}, |
5131 |
|
|
}__; |
5132 |
|
|
@@Set: |
5133 |
|
|
@@@nullCase: |
5134 |
|
|
@@@@enDesc: |
5135 |
|
|
Removes the attribute. |
5136 |
|
|
@@@NodeReadOnlyError: |
5137 |
|
|
@@@PerlDef: |
5138 |
|
|
__CODE{setReflectAttrStringValue:: |
5139 |
|
|
$node => $self, |
5140 |
|
|
$namespaceURI => {null}, |
5141 |
|
|
$localName => 'type', |
5142 |
|
|
$given => $given, |
5143 |
|
|
}__; |
5144 |
|
|
##AtomThreadInReplyToElement |
5145 |
|
|
|
5146 |
|
|
IFClsDef: |
5147 |
|
|
@IFQName: AtomLinkElementThread |
5148 |
|
|
@ClsQName: ManakaiAtomLinkElementThread |
5149 |
|
|
|
5150 |
|
|
@ClsISA: ManakaiAtomLinkElement |
5151 |
|
|
|
5152 |
|
|
@f:implements: AtomThreadingFeature10 |
5153 |
|
|
|
5154 |
|
|
@enDesc: |
5155 |
|
|
An <XE::atom|link> element with a <XA::rel> attribute value of |
5156 |
|
|
<XML::replies> may be used to reference a resource where responses |
5157 |
|
|
to an entry may be found. If the <XA::type> attribute of the |
5158 |
|
|
<XE::atom|link> is omitted, its value is assumed to be |
5159 |
|
|
<XML::application/atom+xml>. |
5160 |
|
|
|
5161 |
|
|
A <XML::replies> link appearing as a child of the <XE::atom|feed> |
5162 |
|
|
or <XE::atom|source> element indicates that the referenced |
5163 |
|
|
resource likely contains responses to any of that |
5164 |
|
|
feed's entries. A <XML::replies> |
5165 |
|
|
link appearing as a child of an <XE::atom|entry> element |
5166 |
|
|
indicates that the linked resource likely contains responses |
5167 |
|
|
specific to that entry. |
5168 |
|
|
|
5169 |
|
|
If the feature <Feature^^DISCore|QName::AtomThreadingFeature10> |
5170 |
|
|
is supported, any <IF::Element> whose element type |
5171 |
|
|
is <XE::atom|link> <kwd:MUST> implement the <IF::AtomLinkElementThread> |
5172 |
|
|
interface in addition to other appropriate interfaces. |
5173 |
|
|
|
5174 |
|
|
@Test: |
5175 |
|
|
@@QName: AtomLinkElementThread.1.test |
5176 |
|
|
@@PerlDef: |
5177 |
|
|
my $doc; |
5178 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
5179 |
|
|
|
5180 |
|
|
my $el = $doc->create_element_ns (<Q::atom|>, 'link'); |
5181 |
|
|
|
5182 |
|
|
$test->id ('interface'); |
5183 |
|
|
$test->assert_isa ($el, <IFName::AtomLinkElementThread>); |
5184 |
|
|
|
5185 |
|
|
$test->id ('feature'); |
5186 |
|
|
$test->assert_true ($el->is_supported (<Q::fe|AtomThreading> => '1.0')); |
5187 |
|
|
|
5188 |
|
|
@ATTR: |
5189 |
|
|
@@Name: threadCount |
5190 |
|
|
@@enDesc: |
5191 |
|
|
The <XA::thr|count> attribute of the element. |
5192 |
|
|
|
5193 |
|
|
It <kwd:MUST> <I::reflect the non-negative integer value |
5194 |
|
|
of the <XA::thr|count> attribute> of the node. |
5195 |
|
|
|
5196 |
|
|
An <XE::atom|link> element using the <XML::replies> |
5197 |
|
|
<XA::rel> attribute value <kwd:MAY> contain |
5198 |
|
|
a <XA::thr|count> attribute whose value is a |
5199 |
|
|
non-negative integer that provides a hint to clients |
5200 |
|
|
as to the total number of replies contained by the |
5201 |
|
|
linked resource. The value is advisory and |
5202 |
|
|
may not accurately reflect the actual number of replies. |
5203 |
|
|
@@Type: idl|long||ManakaiDOM|all |
5204 |
|
|
@@Get: |
5205 |
|
|
@@@PerlDef: |
5206 |
|
|
__CODE{getReflectAttrNonNegativeIntegerValue:: |
5207 |
|
|
$node => $self, |
5208 |
|
|
$namespaceURI => {<Q::thr|>}, |
5209 |
|
|
$localName => 'count', |
5210 |
|
|
$r => $r, |
5211 |
|
|
$defaultValue => {null}, |
5212 |
|
|
}__; |
5213 |
|
|
@@Set: |
5214 |
|
|
@@@NodeReadOnlyError: |
5215 |
|
|
@@@PerlDef: |
5216 |
|
|
__CODE{setReflectAttrNonNegativeIntegerValue:: |
5217 |
|
|
$node => $self, |
5218 |
|
|
$namespaceURI => {<Q::thr|>}, |
5219 |
|
|
$localName => 'count', |
5220 |
|
|
$given => $given, |
5221 |
|
|
}__; |
5222 |
|
|
|
5223 |
|
|
@@Test: |
5224 |
|
|
@@@QName: AtomLinkElementThread.threadCount.1.test |
5225 |
|
|
@@@PerlDef: |
5226 |
|
|
my $doc; |
5227 |
|
|
__CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__; |
5228 |
|
|
|
5229 |
|
|
my $link = $doc->create_element_ns (<Q::atom|>, 'link'); |
5230 |
|
|
|
5231 |
|
|
$test->id ('default'); |
5232 |
|
|
$test->assert_num_equals |
5233 |
|
|
(expected_value => -1, |
5234 |
|
|
actual_value => |
5235 |
|
|
$link-><AG::AtomLinkElementThread.threadCount>); |
5236 |
|
|
|
5237 |
|
|
$test->id ('zero'); |
5238 |
|
|
$link-><AS::AtomLinkElementThread.threadCount> (0); |
5239 |
|
|
$test->assert_num_equals |
5240 |
|
|
(expected_value => 0, |
5241 |
|
|
actual_value => |
5242 |
|
|
$link-><AG::AtomLinkElementThread.threadCount>); |
5243 |
|
|
$test->id ('zero.attr'); |
5244 |
|
|
$test->assert_equals ($link->get_attribute_ns (<Q::thr|>, 'count'), '0'); |
5245 |
|
|
|
5246 |
|
|
$test->id ('one'); |
5247 |
|
|
$link-><AS::AtomLinkElementThread.threadCount> (1); |
5248 |
|
|
$test->assert_num_equals |
5249 |
|
|
(expected_value => 1, |
5250 |
|
|
actual_value => |
5251 |
|
|
$link-><AG::AtomLinkElementThread.threadCount>); |
5252 |
|
|
$test->id ('one.attr'); |
5253 |
|
|
$test->assert_equals ($link->get_attribute_ns (<Q::thr|>, 'count'), '1'); |
5254 |
|
|
|
5255 |
|
|
$test->id ('10000'); |
5256 |
|
|
$link-><AS::AtomLinkElementThread.threadCount> (10000); |
5257 |
|
|
$test->assert_num_equals |
5258 |
|
|
(expected_value => 10000, |
5259 |
|
|
actual_value => |
5260 |
|
|
$link-><AG::AtomLinkElementThread.threadCount>); |
5261 |
|
|
$test->id ('10000.attr'); |
5262 |
|
|
$test->assert_equals ($link->get_attribute_ns (<Q::thr|>, 'count'), |
5263 |
|
|
'10000'); |
5264 |
|
|
|
5265 |
|
|
$test->id ('+10000'); |
5266 |
|
|
$link->set_attribute_ns (<Q::thr|>, 'thr:count', '+10000'); |
5267 |
|
|
$test->assert_num_equals |
5268 |
|
|
(expected_value => 10000, |
5269 |
|
|
actual_value => |
5270 |
|
|
$link-><AG::AtomLinkElementThread.threadCount>); |
5271 |
|
|
|
5272 |
|
|
$test->id ('010000'); |
5273 |
|
|
$link->set_attribute_ns (<Q::thr|>, 'thr:count', '010000'); |
5274 |
|
|
$test->assert_num_equals |
5275 |
|
|
(expected_value => 10000, |
5276 |
|
|
actual_value => |
5277 |
|
|
$link-><AG::AtomLinkElementThread.threadCount>); |
5278 |
|
|
|
5279 |
|
|
$test->id ('-100'); |
5280 |
|
|
$link-><AS::AtomLinkElementThread.threadCount> (-100); |
5281 |
|
|
$test->assert_num_equals |
5282 |
|
|
(expected_value => -1, |
5283 |
|
|
actual_value => |
5284 |
|
|
$link-><AG::AtomLinkElementThread.threadCount>); |
5285 |
|
|
$test->id ('-100.attr'); |
5286 |
|
|
$test->assert_false ($link->has_attribute_ns (<Q::thr|>, 'count')); |
5287 |
|
|
|
5288 |
|
|
$test->id ('120a'); |
5289 |
|
|
$link->set_attribute_ns (<Q::thr|>, 'thr:count', '120a'); |
5290 |
|
|
$test->assert_num_equals |
5291 |
|
|
(expected_value => -1, |
5292 |
|
|
actual_value => |
5293 |
|
|
$link-><AG::AtomLinkElementThread.threadCount>); |
5294 |
|
|
|
5295 |
|
|
$test->id ('-1'); |
5296 |
|
|
$link-><AS::AtomLinkElementThread.threadCount> (-1); |
5297 |
|
|
$test->assert_num_equals |
5298 |
|
|
(expected_value => -1, |
5299 |
|
|
actual_value => |
5300 |
|
|
$link-><AG::AtomLinkElementThread.threadCount>); |
5301 |
|
|
$test->id ('-1.attr'); |
5302 |
|
|
$test->assert_false ($link->has_attribute_ns (<Q::thr|>, 'count')); |
5303 |
|
|
|
5304 |
|
|
@enImplNote: |
5305 |
|
|
@@ddid: updated |
5306 |
|
|
@@@: |
5307 |
|
|
{TODO:: |
5308 |
|
|
<XA::thr|updated> attribute |
5309 |
|
|
} |
5310 |
|
|
##AtomLinkElementThread |
5311 |
|
|
|
5312 |
|
|
enImplNote: |
5313 |
|
|
@@ddid: total |
5314 |
|
|
@@@: |
5315 |
|
|
{TODO:: |
5316 |
|
|
<XE::thr|total> |
5317 |
|
|
} |
5318 |
|
|
|
5319 |
|
|
enImplNote: |
5320 |
|
|
@@ddid: threaddtd |
5321 |
|
|
@@@: |
5322 |
|
|
{TODO:: |
5323 |
|
|
DTD impl for threading |
5324 |
|
|
} |