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