/[suikacvs]/messaging/manakai/lib/Message/Markup/Atom.dis
Suika

Contents of /messaging/manakai/lib/Message/Markup/Atom.dis

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Sat May 20 10:13:02 2006 UTC (17 years, 11 months ago) by wakaba
Branch: MAIN
Changes since 1.5: +138 -16 lines
++ manakai/lib/Message/Markup/ChangeLog	20 May 2006 10:11:52 -0000
	* Atom.dis (AtomDataTypes): New module.

2006-05-20  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/Message/DOM/ChangeLog	20 May 2006 10:11:29 -0000
	* XDP.dis (createXDPRNIKeyword): The Perl method
	name property is added.

2006-05-20  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/manakai/ChangeLog	20 May 2006 10:12:52 -0000
	* DISMarkup.dis: Definitions are added.

	* daf-dtd-modules.pl: Supports for element content
	models and attribute type groups are added.

2006-05-20  Wakaba  <wakaba@suika.fam.cx>

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24