/[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.2 - (hide annotations) (download)
Sat May 6 16:01:04 2006 UTC (17 years, 11 months ago) by wakaba
Branch: MAIN
Changes since 1.1: +22 -1 lines
++ manakai/lib/Message/Markup/ChangeLog	6 May 2006 16:00:58 -0000
	* Atom.dis (contentElement): New attribute.

	* H2H.dis (H2HFeature10): The |Version| was incorrect.
	(new): Finds |XML| feature-implemented object.

	* SuikaWiki.dis (new): Finds |XML| feature-implemented object.

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

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24