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