/[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.3 - (hide annotations) (download)
Sat May 13 05:40:58 2006 UTC (17 years, 11 months ago) by wakaba
Branch: MAIN
Changes since 1.2: +7 -1 lines
++ manakai/lib/Message/DOM/ChangeLog	13 May 2006 05:39:23 -0000
2006-05-13  Wakaba  <wakaba@suika.fam.cx>

	* Traversal.dis (MANAKAI_FILTER_OPAQUE): New |AcceptNode| value.
	(TreeWalker): The |MANAKAI_FILTER_OPAQUE| value support
	is added.  The |FILTER_REJECT| value is treated
	as |FILTER_ACCEPT| if the |currentNode| is in the
	rejected subtree as specified in the spec.

++ manakai/lib/manakai/ChangeLog	13 May 2006 05:40:46 -0000
2006-05-12  Wakaba  <wakaba@suika.fam.cx>

	* DISMarkup.dis: New definitions are added.

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.3 $Date: 2006/05/06 16:01:04 $
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 wakaba 1.3
1813     {ISSUE::
1814     <XE::atom|entry> children <kwd:MUST> be placed after
1815     any other elements. Attributes creating children
1816     should insert them before any entries?
1817     }
1818 wakaba 1.1
1819     @Attr:
1820     @@Name: authorElements
1821     @@enDesc:
1822     A static list of <XE::atom|author> child elements of the node.
1823     @@Type: StaticNodeList
1824     @@Get:
1825     @@@enDesc:
1826     It <kwd:MUST> <I::return a <XE::atom|author> child element list>
1827     of the node.
1828     @@@PerlDef:
1829     __CODE{returnChildElementList::
1830     $node => $self,
1831     $namespaceURI => {<Q::atom|>},
1832     $localName => 'author',
1833     $r => $r,
1834     }__;
1835    
1836     @@Test:
1837     @@@QName: AtomFeedElement.authorElements.empty.test
1838     @@@PerlDef:
1839     my $doc;
1840     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
1841    
1842     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed');
1843    
1844     my $list = $el-><AG::AtomFeedElement.authorElements>;
1845    
1846     $test->id ('interface');
1847     $test->assert_isa ($list, <IFName::StaticNodeList>);
1848    
1849     $test->id ('length');
1850     $test->assert_num_equals
1851     (actual_value => 0+@{$list}, expected_value => 0);
1852    
1853     $test->id ('readOnly');
1854     $test->assert_false ($list-><AG::NodeList.manakaiReadOnly>);
1855     @@Test:
1856     @@@QName: AtomFeedElement.authorElements.two.test
1857     @@@PerlDef:
1858     my $doc;
1859     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
1860    
1861     my $e1 = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed');
1862     my $a1 = $doc-><M::Document.createElementNS> (<Q::atom|>, 'author');
1863     $e1-><M::Node.appendChild> ($a1);
1864     my $a2 = $doc-><M::Document.createElementNS> (<Q::atom|>, 'author');
1865     $e1-><M::Node.appendChild> ($a2);
1866    
1867     my $list = $e1-><AG::AtomFeedElement.authorElements>;
1868     my $a3 = $doc-><M::Document.createElementNS> (<Q::atom|>, 'author');
1869     $e1-><M::Node.appendChild> ($a3);
1870    
1871     $test->id ('length');
1872     $test->assert_num_equals
1873     (actual_value => 0+@{$list}, expected_value => 2);
1874    
1875     $test->id (0);
1876     $test->assert_equals ($list->[0], $a1);
1877    
1878     $test->id (1);
1879     $test->assert_equals ($list->[1], $a2);
1880    
1881     @Attr:
1882     @@Name: categoryElements
1883     @@enDesc:
1884     A static list of <XE::atom|category> child elements of the node.
1885     @@Type: StaticNodeList
1886     @@Get:
1887     @@@enDesc:
1888     It <kwd:MUST> <I::return a <XE::atom|category> child element list>
1889     of the node.
1890     @@@PerlDef:
1891     __CODE{returnChildElementList::
1892     $node => $self,
1893     $namespaceURI => {<Q::atom|>},
1894     $localName => 'category',
1895     $r => $r,
1896     }__;
1897    
1898     @Attr:
1899     @@Name: contributorElements
1900     @@enDesc:
1901     A static list of <XE::atom|contributor> child elements of the node.
1902     @@Type: StaticNodeList
1903     @@Get:
1904     @@@enDesc:
1905     It <kwd:MUST> <I::return a <XE::atom|contributor> child element list>
1906     of the node.
1907     @@@PerlDef:
1908     __CODE{returnChildElementList::
1909     $node => $self,
1910     $namespaceURI => {<Q::atom|>},
1911     $localName => 'contributor',
1912     $r => $r,
1913     }__;
1914    
1915     @Attr:
1916     @@Name: generatorElement
1917     @@enDesc:
1918     The <XE::atom|generator> child element of the node.
1919     @@Type: AtomGeneratorElement
1920     @@Get:
1921     @@@enDesc:
1922     It <kwd:MUST> <I::return a <XE::atom|generator> child element>
1923     of the node.
1924     @@@nullCase:
1925     @@@@enDesc:
1926     If the algorithm returns <DOM::null>.
1927     @@@NodeReadOnlyError:
1928     @@@PerlDef:
1929     __CODE{returnChildElement::
1930     $node => $self,
1931     $namespaceURI => {<Q::atom|>},
1932     $localName => 'generator',
1933     $r => $r,
1934     }__;
1935    
1936     @@Test:
1937     @@@QName: AtomFeedElement.generatorElement.test
1938     @@@PerlDef:
1939     my $doc;
1940     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
1941    
1942     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed');
1943    
1944     $test->id ('no');
1945     $test->assert_null ($el-><AG::AtomFeedElement.generatorElement>);
1946    
1947     $doc-><AG::Document.domConfig>
1948     -><M::CFG.setParameter> (<Q::cfg|create-child-element> => true);
1949     my $ge = $el-><AG::AtomFeedElement.generatorElement>;
1950    
1951     $test->id ('create.interface');
1952     $test->assert_isa ($ge, <IFName::Element>);
1953    
1954     $test->id ('create.namespaceURI');
1955     $test->assert_equals ($ge-><AG::Node.namespaceURI>, <Q::atom|>);
1956    
1957     $test->id ('create.localName');
1958     $test->assert_equals ($ge-><AG::Node.localName>, 'generator');
1959    
1960     $test->id ('has');
1961     my $ge2 = $el-><AG::AtomFeedElement.generatorElement>;
1962     $test->assert_equals ($ge2, $ge);
1963    
1964     $test->id ('multiple');
1965     $el-><M::Node.appendChild>
1966     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'generator'));
1967     my $ge3 = $el-><AG::AtomFeedElement.generatorElement>;
1968     $test->assert_equals ($ge3, $ge);
1969    
1970     @Attr:
1971     @@Name: icon
1972     @@enDesc:
1973     The <XE::atom|icon> value of the feed.
1974    
1975     It <kwd:MUST> <I::reflect the URI value
1976     of the <XE::atom|icon> child element> of the node.
1977     @@Type: DOMString
1978     @@actualType: DOMURI
1979     @@Get:
1980     @@@nullCase:
1981     @@@@enDesc:
1982     If the algorithm returns <DOM::null>.
1983     @@@NodeReadOnlyError:
1984     @@@PerlDef:
1985     __CODE{getReflectURIValue::
1986     $node => $self,
1987     $namespaceURI => {<Q::atom|>},
1988     $localName => 'icon',
1989     $r => $r,
1990     }__;
1991     @@Set:
1992     @@@nullCase:
1993     @@@@enDesc:
1994     Removes the value.
1995     @@@NodeReadOnlyError:
1996     @@@PerlDef:
1997     __CODE{setReflectURIValue::
1998     $node => $self,
1999     $namespaceURI => {<Q::atom|>},
2000     $localName => 'icon',
2001     $given => $given,
2002     }__;
2003    
2004     @@Test:
2005     @@@QName: AtomFeedElement.icon.test
2006     @@@PerlDef:
2007     my $doc;
2008     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
2009    
2010     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed');
2011    
2012     $test->id ('default');
2013     $test->assert_null ($el-><AG::AtomFeedElement.icon>);
2014    
2015     $test->id ('set');
2016     $el-><AS::AtomFeedElement.icon> ('http://example.com/');
2017     $test->assert_equals ($el-><AG::AtomFeedElement.icon>,
2018     'http://example.com/');
2019    
2020     $test->id ('relative');
2021     $el-><AS::AtomFeedElement.icon> ('favicon.ico');
2022     $test->assert_equals ($el-><AG::AtomFeedElement.icon>,
2023     'favicon.ico');
2024    
2025     $test->id ('relative.base');
2026     $el-><M::Element.setAttributeNS> (<Q::xml:>, 'xml:base',
2027     'http://www.example.com/');
2028     $test->assert_equals ($el-><AG::AtomFeedElement.icon>,
2029     'http://www.example.com/favicon.ico');
2030    
2031     $test->id ('multiple');
2032     $el-><M::Node.appendChild>
2033     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'icon'))
2034     -><AS::Node.textContent> ('/default.ico'); # ignored
2035     $test->assert_equals ($el-><AG::AtomFeedElement.icon>,
2036     'http://www.example.com/favicon.ico');
2037    
2038     $test->id ('remove');
2039     $el-><AS::AtomFeedElement.icon> (null);
2040     $test->assert_null ($el-><AG::AtomFeedElement.icon>);
2041    
2042     @Attr:
2043     @@Name: id
2044     @@enDesc:
2045     The <XE::atom|id> value of the feed.
2046    
2047     It <kwd:MUST> <I::reflect the string value
2048     of the <XE::atom|id> child element> of the node.
2049     @@Type: DOMString
2050     @@actualType: DOMURI
2051     @@Get:
2052     @@@nullCase:
2053     @@@@enDesc:
2054     If the algorithm returns <DOM::null>.
2055     @@@NodeReadOnlyError:
2056     @@@PerlDef:
2057     __CODE{getReflectStringValue::
2058     $node => $self,
2059     $namespaceURI => {<Q::atom|>},
2060     $localName => 'id',
2061     $r => $r,
2062     }__;
2063     @@Set:
2064     @@@nullCase:
2065     @@@@enDesc:
2066     Removes the value.
2067     @@@NodeReadOnlyError:
2068     @@@PerlDef:
2069     __CODE{setReflectStringValue::
2070     $node => $self,
2071     $namespaceURI => {<Q::atom|>},
2072     $localName => 'id',
2073     $given => $given,
2074     }__;
2075    
2076     @@Test:
2077     @@@QName: AtomFeedElement.id.test
2078     @@@PerlDef:
2079     my $doc;
2080     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
2081    
2082     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed');
2083    
2084     $test->id ('default');
2085     $test->assert_null ($el-><AG::AtomFeedElement.id>);
2086    
2087     $test->id ('set');
2088     $el-><AS::AtomFeedElement.id> ('http://example.com/');
2089     $test->assert_equals ($el-><AG::AtomFeedElement.id>,
2090     'http://example.com/');
2091    
2092     $test->id ('relative');
2093     $el-><AS::AtomFeedElement.id> ('favicon.ico');
2094     $test->assert_equals ($el-><AG::AtomFeedElement.id>,
2095     'favicon.ico');
2096    
2097     $test->id ('relative.base');
2098     $el-><M::Element.setAttributeNS> (<Q::xml:>, 'xml:base',
2099     'http://www.example.com/');
2100     $test->assert_equals ($el-><AG::AtomFeedElement.id>,
2101     'favicon.ico');
2102    
2103     $test->id ('multiple');
2104     $el-><M::Node.appendChild>
2105     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'id'))
2106     -><AS::Node.textContent> ('/default.ico'); # ignored
2107     $test->assert_equals ($el-><AG::AtomFeedElement.id>,
2108     'favicon.ico');
2109    
2110     $test->id ('remove');
2111     $el-><AS::AtomFeedElement.id> (null);
2112     $test->assert_null ($el-><AG::AtomFeedElement.id>);
2113    
2114     @Attr:
2115     @@Name: linkElements
2116     @@enDesc:
2117     A static list of <XE::atom|link> child elements of the node.
2118     @@Type: StaticNodeList
2119     @@Get:
2120     @@@enDesc:
2121     It <kwd:MUST> <I::return a <XE::atom|link> child element list>
2122     of the node.
2123     @@@PerlDef:
2124     __CODE{returnChildElementList::
2125     $node => $self,
2126     $namespaceURI => {<Q::atom|>},
2127     $localName => 'link',
2128     $r => $r,
2129     }__;
2130    
2131     @Attr:
2132     @@Name: logo
2133     @@enDesc:
2134     The <XE::atom|logo> value of the feed.
2135    
2136     It <kwd:MUST> <I::reflect the URI value
2137     of the <XE::atom|logo> child element> of the node.
2138     @@Type: DOMString
2139     @@actualType: DOMURI
2140     @@Get:
2141     @@@nullCase:
2142     @@@@enDesc:
2143     If the algorithm returns <DOM::null>.
2144     @@@NodeReadOnlyError:
2145     @@@PerlDef:
2146     __CODE{getReflectURIValue::
2147     $node => $self,
2148     $namespaceURI => {<Q::atom|>},
2149     $localName => 'logo',
2150     $r => $r,
2151     }__;
2152     @@Set:
2153     @@@nullCase:
2154     @@@@enDesc:
2155     Removes the value.
2156     @@@NodeReadOnlyError:
2157     @@@PerlDef:
2158     __CODE{setReflectURIValue::
2159     $node => $self,
2160     $namespaceURI => {<Q::atom|>},
2161     $localName => 'logo',
2162     $given => $given,
2163     }__;
2164    
2165     @Attr:
2166     @@Name: rightsElement
2167     @@enDesc:
2168     The <XE::atom|rights> child element of the node.
2169     @@Type: AtomRightsElement
2170     @@Get:
2171     @@@enDesc:
2172     It <kwd:MUST> <I::return a <XE::atom|rights> child element>
2173     of the node.
2174     @@@nullCase:
2175     @@@@enDesc:
2176     If the algorithm returns <DOM::null>.
2177     @@@NodeReadOnlyError:
2178     @@@PerlDef:
2179     __CODE{returnChildElement::
2180     $node => $self,
2181     $namespaceURI => {<Q::atom|>},
2182     $localName => 'rights',
2183     $r => $r,
2184     }__;
2185    
2186     @Attr:
2187     @@Name: subtitleElement
2188     @@enDesc:
2189     The <XE::atom|subtitle> child element of the node.
2190     @@Type: AtomSubtitleElement
2191     @@Get:
2192     @@@enDesc:
2193     It <kwd:MUST> <I::return a <XE::atom|subtitle> child element>
2194     of the node.
2195     @@@nullCase:
2196     @@@@enDesc:
2197     If the algorithm returns <DOM::null>.
2198     @@@NodeReadOnlyError:
2199     @@@PerlDef:
2200     __CODE{returnChildElement::
2201     $node => $self,
2202     $namespaceURI => {<Q::atom|>},
2203     $localName => 'subtitle',
2204     $r => $r,
2205     }__;
2206    
2207     @Attr:
2208     @@Name: titleElement
2209     @@enDesc:
2210     The <XE::atom|title> child element of the node.
2211     @@Type: AtomTitleElement
2212     @@Get:
2213     @@@enDesc:
2214     It <kwd:MUST> <I::return a <XE::atom|title> child element>
2215     of the node.
2216     @@@nullCase:
2217     @@@@enDesc:
2218     If the algorithm returns <DOM::null>.
2219     @@@NodeReadOnlyError:
2220     @@@PerlDef:
2221     __CODE{returnChildElement::
2222     $node => $self,
2223     $namespaceURI => {<Q::atom|>},
2224     $localName => 'title',
2225     $r => $r,
2226     }__;
2227    
2228     @Attr:
2229     @@Name: updatedElement
2230     @@enDesc:
2231     The <XE::atom|updated> child element of the node.
2232     @@Type: AtomUpdatedElement
2233     @@Get:
2234     @@@enDesc:
2235     It <kwd:MUST> <I::return a <XE::atom|updated> child element>
2236     of the node.
2237     @@@nullCase:
2238     @@@@enDesc:
2239     If the algorithm returns <DOM::null>.
2240     @@@NodeReadOnlyError:
2241     @@@PerlDef:
2242     __CODE{returnChildElement::
2243     $node => $self,
2244     $namespaceURI => {<Q::atom|>},
2245     $localName => 'updated',
2246     $r => $r,
2247     }__;
2248    
2249     @Attr:
2250     @@Name: entryElements
2251     @@enDesc:
2252     A static list of <XE::atom|entry> child elements of the node.
2253     @@Type: StaticNodeList
2254     @@Get:
2255     @@@enDesc:
2256     It <kwd:MUST> <I::return a <XE::atom|entry> child element list>
2257     of the node.
2258     @@@PerlDef:
2259     __CODE{returnChildElementList::
2260     $node => $self,
2261     $namespaceURI => {<Q::atom|>},
2262     $localName => 'entry',
2263     $r => $r,
2264     }__;
2265    
2266     @Method:
2267     @@Name: getEntryElementById
2268     @@enDesc:
2269     Returns an <XE::atom|entry> node selected by its <XE::atom|id>.
2270     @@Param:
2271     @@@Name: idArg
2272     @@@Type: DOMString
2273     @@@actualType: DOMURI
2274     @@@enDesc:
2275     The identifier of the entry.
2276     @@Return:
2277     @@@Type: AtomEntryElement
2278     @@@enDesc:
2279     The <XE::atom|entry> element whose identifier equals to
2280     <P::id>.
2281    
2282     It <kwd:MUST> return the first child element node in document
2283     order whose element type is <XE::atom|entry> and
2284     whose first child element node in document order
2285     with element type <XE::atom|id> has <A::Node.textContent>
2286     equals to <P::id>, if any, or <DOM::null>.
2287     @@@nullCase:
2288     @@@@enDesc:
2289     If no matching element.
2290     @@@PerlDef:
2291     E: {
2292     no warnings 'uninitialized';
2293     for my $cn (@{$self-><AG::Node.childNodes>}) {
2294     if ($cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and
2295     $cn-><AG::Node.localName> eq 'entry' and
2296     $cn-><AG::Node.namespaceURI> eq <Q::atom|>) {
2297     if ($cn-><AG::AtomEntryElement.id> eq $idArg) {
2298     $r = $cn;
2299     last E;
2300     }
2301     }
2302     }
2303     } # E
2304    
2305     @Method:
2306     @@Name: addNewEntry
2307     @@enDesc:
2308     Creates an <XA::atom|entry> element node and
2309     appends to the node.
2310     @@Param:
2311     @@@Name: id
2312     @@@Type: DOMString
2313     @@@actualType: DOMURI
2314     @@@enDesc:
2315     The <XE::atom|id> of the entry.
2316     @@Param:
2317     @@@Name: title
2318     @@@Type: DOMString
2319     @@@enDesc:
2320     The <XE::atom|title> of the entry.
2321     @@@nullCase:
2322     @@@@enDesc:
2323     The implementation <kwd:MUST> treate <DOM::null>
2324     as if an empty string is specified.
2325     @@Param:
2326     @@@Name: lang
2327     @@@Type: DOMString
2328     @@@enDesc:
2329     The natural language of the entry.
2330     @@@nullCase:
2331     @@@@enDesc:
2332     No explicit language specification is added.
2333     @@Return:
2334     @@@Type: AtomEntryElement
2335     @@@enDesc:
2336     The newly created <XE::atom|entry> element.
2337    
2338     {P:: The newly created <XE::atom|entry> element node <kwd:MUST>
2339     have attributes set as:
2340    
2341     - <A::Node.attributes>::: A <IF::NamedNodeMap> that contains
2342     at least a new <XA::xml|lang>
2343     attribute node except when
2344     the <P::lang> parameter is set
2345     to <DOM::null>.
2346    
2347     - <A::Node.childNodes>::: A <IF::NodeList> containing
2348     a new <XE::atom|id> element node,
2349     a new <XE::atom|title> element node, and
2350     a new <XE::atom|updated> element node
2351     in any order.
2352    
2353     }
2354    
2355     This element node <kwd:MUST> be appended to the node
2356     as if the <M::Node.appendChild> method were invoked
2357     on the node and <kwd:MUST> be returned by the method.
2358     Note that an exception might be thrown during this course.
2359    
2360     {P:: The <XA::xml|lang> attribute node, if created, <kwd:MUST>
2361     have attributes set as:
2362    
2363     - <A::Node.nodeValue>::: <P::lang>.
2364    
2365     - <A::Attr.specified>::: <DOM::true>.
2366    
2367     }
2368    
2369     {P:: The newly created <XE::atom|id> element node <kwd:MUST>
2370     have attributes set as:
2371    
2372     - <A::Node.textContent>::: <P::id>.
2373    
2374     }
2375    
2376     {P:: The newly created <XE::atom|title> element node <kwd:MUST>
2377     have attributes set as:
2378    
2379     - <A::Node.textContent>::: <P::title>.
2380    
2381     }
2382    
2383     The <XA::type> attribute node <kwd:MUST-NOT> be attached
2384     to the <XE::atom|title> element node.
2385    
2386     {P:: The newly created <XE::atom|updated> element node <kwd:MUST>
2387     have attributes set as:
2388    
2389     - <A::Node.textContent>::: A uppercase RFC 3339 <CODE::date-time>
2390     representation of the time when the method is invoked.
2391     The implementation <kwd:MAY> align its timezone to
2392     that of the environment in which the method is invoked.
2393    
2394     }
2395     @@@PerlDef:
2396     __DEEP{
2397     my $od = $self-><AG::Node.ownerDocument>;
2398    
2399     $r = $od-><M::Document.createElementNS> (<Q::atom|>, 'entry');
2400     $r-><AS::Node.manakaiLanguage> ($lang) if defined $lang;
2401    
2402     $r-><AS::AtomFeedElement.id> ($id);
2403    
2404     my $titlee = $od-><M::Document.createElementNS> (<Q::atom|>, 'title');
2405     $titlee-><AS::Node.textContent> (defined $title ? $title : '');
2406     $r-><M::Node.appendChild> ($titlee);
2407    
2408     my $updatede = $od-><M::Document.createElementNS>
2409     (<Q::atom|>, 'updated');
2410     $updatede-><AS::AtomDateConstruct.value> (scalar time);
2411     $r-><M::Node.appendChild> ($updatede);
2412     }__;
2413    
2414     @@Test:
2415     @@@QName: AtomFeedElement.addNewEntry.1.test
2416     @@@PerlDef:
2417     my $doc;
2418     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
2419    
2420     my $feed = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed');
2421    
2422     my $ent = $feed-><M::AtomFeedElement.addNewEntry>
2423     ('about:id', 'entry title', 'en');
2424    
2425     $test->id ('entry.interface');
2426     $test->assert_isa ($ent, <IFName::AtomEntryElement>);
2427    
2428     $test->id ('entry.namespaceURI');
2429     $test->assert_equals ($ent-><AG::Node.namespaceURI>, <Q::atom|>);
2430    
2431     $test->id ('entry.localName');
2432     $test->assert_equals ($ent-><AG::Node.localName>, 'entry');
2433    
2434     $test->id ('entry.lang');
2435     $test->assert_equals ($ent-><M::Element.getAttributeNS>
2436     (<Q::xml|>, 'lang'),
2437     'en');
2438    
2439     my $id;
2440     my $title;
2441     my $updated;
2442    
2443     for my $cn (@{$ent-><AG::Node.childNodes>}) {
2444     if ($cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and
2445     $cn-><AG::Node.namespaceURI> eq <Q::atom|>) {
2446     if ($cn-><AG::Node.localName> eq 'id') {
2447     $id = $cn;
2448     } elsif ($cn-><AG::Node.localName> eq 'title') {
2449     $title = $cn;
2450     } elsif ($cn-><AG::Node.localName> eq 'updated') {
2451     $updated = $cn;
2452     }
2453     }
2454     }
2455    
2456     $test->id ('id');
2457     $test->assert_not_null ($id);
2458    
2459     $test->id ('id.value');
2460     $test->assert_equals ($id-><AG::Node.textContent>, 'about:id');
2461    
2462     $test->id ('title');
2463     $test->assert_not_null ($title);
2464    
2465     $test->id ('title.value');
2466     $test->assert_equals ($title-><AG::Node.textContent>, 'entry title');
2467    
2468     $test->id ('title.type');
2469     $test->assert_null ($title-><M::Element.getAttributeNS> (null, 'type'));
2470    
2471     $test->id ('updated');
2472     $test->assert_not_null ($updated);
2473    
2474     $test->id ('updated.value');
2475     $test->assert_num_not_equals
2476     (actual_value => $updated-><AG::AtomDateConstruct.value>,
2477     expected_value => 0);
2478     @@Test:
2479     @@@QName: AtomFeedElement.addNewEntry.2.test
2480     @@@enDesc:
2481     <DOM::null> <CODE::lang>.
2482     @@@PerlDef:
2483     my $doc;
2484     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
2485    
2486     my $feed = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed');
2487    
2488     my $ent = $feed-><M::AtomFeedElement.addNewEntry>
2489     ('about:id', 'entry title', null);
2490    
2491     $test->id ('entry.lang');
2492     $test->assert_null ($ent-><M::Element.getAttributeNS>
2493     (<Q::xml|>, 'lang'));
2494     ##AtomFeedElement
2495    
2496     IFClsETDef:
2497     @IFQName: AtomEntryElement
2498     @ETQName: atom|entry
2499     @ETRQName: atom|entry
2500     @ClsQName: ManakaiAtomEntryElement
2501    
2502     @IFISA: AtomElement
2503     @ClsISA: ManakaiAtomElement
2504    
2505     @enDesc:
2506     The <XE::atom|entry> element represents an individual
2507     entry, acting as a container for metadata and data
2508     associated with the entry.
2509    
2510     @Attr:
2511     @@Name: authorElements
2512     @@enDesc:
2513     A static list of <XE::atom|author> child elements of the node.
2514     @@Type: StaticNodeList
2515     @@Get:
2516     @@@enDesc:
2517     It <kwd:MUST> <I::return a <XE::atom|author> child element list>
2518     of the node.
2519     @@@disDef:
2520     @@@@dlp:cloneCode: ManakaiAtomFeedElement.authorElements.get
2521    
2522     @Attr:
2523     @@Name: entryAuthorElements
2524     @@enDesc:
2525     A static list of <XE::atom|author> elements for the node.
2526     @@Type: StaticNodeList
2527     @@Get:
2528     @@@enDesc:
2529     = If the node contains one or more <XE::atom|author>
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::AtomEntryElement.authorElements>
2533     attribute of the node.
2534    
2535     = Otherwise, if the node contains a <XE::atom|source>
2536     element node in its child node list, then it
2537     <kwd:MUST> return a <IF::StaticNodeList> that
2538     would be returned by the <A::AtomSourceElement.authorElements>
2539     attribute of that node, unless its <A::NodeList.length>
2540     is zero.
2541    
2542     = Otherwise, if the <A::Node.parentNode> of the
2543     node is a <XE::atom|feed> element node, then
2544     it <kwd:MUST> return a <IF::StaticNodeList> that
2545     would be returned by the <A::AtomFeedElement.authorElements>
2546     attribute of that node.
2547    
2548     = Otherwise, it <kwd:MUST> return a <IF::StaticNodeList>
2549     whose <A::NodeList.length> is zero.
2550     @@@PerlDef:
2551     __DEEP{
2552     E: {
2553     no warnings 'uninitialized';
2554     __CODE{tc|createStaticNodeList:: $r => $r}__;
2555    
2556     my $source;
2557     for my $cn (@{$self-><AG::Node.childNodes>}) {
2558     if ($cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and
2559     $cn-><AG::Node.namespaceURI> eq <Q::atom|>) {
2560     if ($cn-><AG::Node.localName> eq 'author') {
2561     push @{$r}, $cn;
2562     } elsif ($cn-><AG::Node.localName> eq 'source') {
2563     $source = $cn;
2564     }
2565     }
2566     }
2567     last E unless @{$r} == 0;
2568    
2569     if (defined $source) {
2570     $r = $source-><AG::AtomSourceElement.authorElements>;
2571     }
2572     last E unless @{$r} == 0;
2573    
2574     my $parent = $self-><AG::Node.parentNode>;
2575     if (defined $parent and
2576     $parent-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and
2577     $parent-><AG::Node.namespaceURI> eq <Q::atom|> and
2578     $parent-><AG::Node.localName> eq 'feed') {
2579     $r = $parent-><AG::AtomFeedElement.authorElements>;
2580     }
2581     } # E
2582     }__;
2583    
2584     @@Test:
2585     @@@QName: AtomEntryElement.entryAuthorElements.1.test
2586     @@@PerlDef:
2587     my $doc;
2588     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
2589    
2590     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'entry');
2591    
2592    
2593     $test->id ('empty');
2594     my $list = $el-><AG::AtomEntryElement.entryAuthorElements>;
2595     $test->assert_num_equals (actual_value => 0+@$list, expected_value => 0);
2596    
2597     $test->id ('one');
2598     $el-><M::Node.appendChild>
2599     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2600     $list = $el-><AG::AtomEntryElement.entryAuthorElements>;
2601     $test->assert_num_equals (actual_value => 0+@$list, expected_value => 1);
2602    
2603     $test->id ('source');
2604     for ($el-><M::Node.appendChild>
2605     ($doc-><M::Document.createElementNS>
2606     (<Q::atom|>, 'source'))) {
2607     $_-><M::Node.appendChild>
2608     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2609     $_-><M::Node.appendChild>
2610     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2611     }
2612     $list = $el-><AG::AtomEntryElement.entryAuthorElements>;
2613     $test->assert_num_equals (actual_value => 0+@$list, expected_value => 1);
2614    
2615     $test->id ('parent');
2616     for ($doc-><M::Document.createElementNS> (<Q::atom|>, 'feed')) {
2617     $_-><M::Node.appendChild>
2618     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2619     $_-><M::Node.appendChild>
2620     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2621     $_-><M::Node.appendChild>
2622     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2623     $_-><M::Node.appendChild> ($el);
2624     }
2625     $list = $el-><AG::AtomEntryElement.entryAuthorElements>;
2626     $test->assert_num_equals (actual_value => 0+@$list, expected_value => 1);
2627     @@Test:
2628     @@@QName: AtomEntryElement.entryAuthorElements.2.test
2629     @@@PerlDef:
2630     my $doc;
2631     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
2632    
2633     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'entry');
2634    
2635     $test->id ('source');
2636     for ($el-><M::Node.appendChild>
2637     ($doc-><M::Document.createElementNS>
2638     (<Q::atom|>, 'source'))) {
2639     $_-><M::Node.appendChild>
2640     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2641     $_-><M::Node.appendChild>
2642     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2643     }
2644     my $list = $el-><AG::AtomEntryElement.entryAuthorElements>;
2645     $test->assert_num_equals (actual_value => 0+@$list, expected_value => 2);
2646    
2647     $test->id ('parent');
2648     for ($doc-><M::Document.createElementNS> (<Q::atom|>, 'feed')) {
2649     $_-><M::Node.appendChild>
2650     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2651     $_-><M::Node.appendChild>
2652     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2653     $_-><M::Node.appendChild>
2654     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2655     $_-><M::Node.appendChild> ($el);
2656     }
2657     $list = $el-><AG::AtomEntryElement.entryAuthorElements>;
2658     $test->assert_num_equals (actual_value => 0+@$list, expected_value => 2);
2659     @@Test:
2660     @@@QName: AtomEntryElement.entryAuthorElements.3.test
2661     @@@PerlDef:
2662     my $doc;
2663     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
2664    
2665     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'entry');
2666    
2667     $test->id ('source');
2668     for ($el-><M::Node.appendChild>
2669     ($doc-><M::Document.createElementNS>
2670     (<Q::atom|>, 'source'))) {
2671     # empty
2672     }
2673     my $list = $el-><AG::AtomEntryElement.entryAuthorElements>;
2674     $test->assert_num_equals (actual_value => 0+@$list, expected_value => 0);
2675    
2676     $test->id ('parent');
2677     for ($doc-><M::Document.createElementNS> (<Q::atom|>, 'feed')) {
2678     $_-><M::Node.appendChild>
2679     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2680     $_-><M::Node.appendChild>
2681     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2682     $_-><M::Node.appendChild>
2683     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2684     $_-><M::Node.appendChild> ($el);
2685     }
2686     $list = $el-><AG::AtomEntryElement.entryAuthorElements>;
2687     $test->assert_num_equals (actual_value => 0+@$list, expected_value => 3);
2688     @@Test:
2689     @@@QName: AtomEntryElement.entryAuthorElements.4.test
2690     @@@PerlDef:
2691     my $doc;
2692     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
2693    
2694     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'entry');
2695    
2696     $test->id ('parent');
2697     for ($doc-><M::Document.createElementNS> (<Q::atom|>, 'feed')) {
2698     $_-><M::Node.appendChild>
2699     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2700     $_-><M::Node.appendChild>
2701     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2702     $_-><M::Node.appendChild>
2703     ($doc-><M::Document.createElementNS> (<Q::atom|>, 'author'));
2704     $_-><M::Node.appendChild> ($el);
2705     }
2706     my $list = $el-><AG::AtomEntryElement.entryAuthorElements>;
2707     $test->assert_num_equals (actual_value => 0+@$list, expected_value => 3);
2708    
2709     @Attr:
2710     @@Name: categoryElements
2711     @@enDesc:
2712     A static list of <XE::atom|category> child elements of the node.
2713     @@Type: StaticNodeList
2714     @@Get:
2715     @@@enDesc:
2716     It <kwd:MUST> <I::return a <XE::atom|category> child element list>
2717     of the node.
2718     @@@disDef:
2719     @@@@dlp:cloneCode: ManakaiAtomFeedElement.categoryElements.get
2720 wakaba 1.2
2721     @Attr:
2722     @@Name: contentElement
2723     @@enDesc:
2724     The <XE::atom|content> child element of the node.
2725     @@Type: AtomContentElement
2726     @@Get:
2727     @@@enDesc:
2728     It <kwd:MUST> <I::return a <XE::atom|content> child element>
2729     of the node.
2730     @@@nullCase:
2731     @@@@enDesc:
2732     If the algorithm returns <DOM::null>.
2733     @@@NodeReadOnlyError:
2734     @@@PerlDef:
2735     __CODE{returnChildElement::
2736     $node => $self,
2737     $namespaceURI => {<Q::atom|>},
2738     $localName => 'content',
2739     $r => $r,
2740     }__;
2741 wakaba 1.1
2742     @Attr:
2743     @@Name: contributorElements
2744     @@enDesc:
2745     A static list of <XE::atom|contributor> child elements of the node.
2746     @@Type: StaticNodeList
2747     @@Get:
2748     @@@enDesc:
2749     It <kwd:MUST> <I::return a <XE::atom|contributor> child element list>
2750     of the node.
2751     @@@disDef:
2752     @@@@dlp:cloneCode: ManakaiAtomFeedElement.contributorElements.get
2753    
2754     @Attr:
2755     @@Name: id
2756     @@enDesc:
2757     The <XE::atom|id> value of the feed.
2758    
2759     It <kwd:MUST> <I::reflect the string value
2760     of the <XE::atom|id> child element> of the node.
2761     @@Type: DOMString
2762     @@actualType: DOMURI
2763     @@Get:
2764     @@@nullCase:
2765     @@@@enDesc:
2766     If the algorithm returns <DOM::null>.
2767     @@@NodeReadOnlyError:
2768     @@@disDef:
2769     @@@@dlp:cloneCode: ManakaiAtomFeedElement.id.get
2770     @@Set:
2771     @@@nullCase:
2772     @@@@enDesc:
2773     Removes the value.
2774     @@@NodeReadOnlyError:
2775     @@@disDef:
2776     @@@@dlp:cloneCode: ManakaiAtomFeedElement.id.set
2777    
2778     @Attr:
2779     @@Name: linkElements
2780     @@enDesc:
2781     A static list of <XE::atom|link> child elements of the node.
2782     @@Type: StaticNodeList
2783     @@Get:
2784     @@@enDesc:
2785     It <kwd:MUST> <I::return a <XE::atom|link> child element list>
2786     of the node.
2787     @@@disDef:
2788     @@@@dlp:cloneCode: ManakaiAtomFeedElement.linkElements.get
2789    
2790     @Attr:
2791     @@Name: publishedElement
2792     @@enDesc:
2793     The <XE::atom|published> child element of the node.
2794     @@Type: AtomPublishedElement
2795     @@Get:
2796     @@@enDesc:
2797     It <kwd:MUST> <I::return a <XE::atom|published> child element>
2798     of the node.
2799     @@@nullCase:
2800     @@@@enDesc:
2801     If the algorithm returns <DOM::null>.
2802     @@@NodeReadOnlyError:
2803     @@@PerlDef:
2804     __CODE{returnChildElement::
2805     $node => $self,
2806     $namespaceURI => {<Q::atom|>},
2807     $localName => 'published',
2808     $r => $r,
2809     }__;
2810    
2811     @Attr:
2812     @@Name: rightsElement
2813     @@enDesc:
2814     The <XE::atom|rights> child element of the node.
2815     @@Type: AtomRightsElement
2816     @@Get:
2817     @@@enDesc:
2818     It <kwd:MUST> <I::return a <XE::atom|rights> child element>
2819     of the node.
2820     @@@nullCase:
2821     @@@@enDesc:
2822     If the algorithm returns <DOM::null>.
2823     @@@NodeReadOnlyError:
2824     @@@disDef:
2825     @@@@dlp:cloneCode: ManakaiAtomFeedElement.rightsElement.get
2826    
2827     @Attr:
2828     @@Name: entryRightsElement
2829     @@enDesc:
2830     The <XE::atom|rights> element for the node.
2831     @@Type: AtomRightsElement
2832     @@Get:
2833     @@@enDesc:
2834     = If the node contains a <XE::atom|rights>
2835     element node in its child node list, then it
2836     <kwd:MUST> return the first such a node in document order.
2837    
2838     = Otherwise, if the <A::Node.parentNode> of the
2839     node is a <XE::atom|feed> element node, then
2840     it <kwd:MUST> return an <IF::AtomRightsElement>
2841     that would be returned by the <A::AtomFeedElement.rightsElement>
2842     attribute of that node, except when it is <DOM::null>.
2843    
2844     {OLI:: Otherwise,
2845    
2846     {OLI:: If the <cfg::cfg|create-child-element> configuration
2847     parameter is set to <DOM::true>,
2848    
2849     = Create an element node <VAR::N> whose element type
2850     is <XE::atom|rights>.
2851    
2852     = Append <VAR::N> to this node as if the <M::Node.appendChild>
2853     method were called for the node with its parameter
2854     set to <VAR::N>. Note that this might throw an exception.
2855    
2856     = Then, <VAR::N> <kwd:MUST> be returned.
2857    
2858     }
2859    
2860     = Otherwise, it <kwd:MUST> return <DOM::null>.
2861     }
2862     @@@nullCase:
2863     @@@@enDesc:
2864     If the algorithm returns <DOM::null>.
2865     @@@NodeReadOnlyError:
2866     @@@PerlDef:
2867     __DEEP{
2868     E: {
2869     no warnings 'uninitialized';
2870     for my $cn (@{$self-><AG::Node.childNodes>}) {
2871     if ($cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and
2872     $cn-><AG::Node.localName> eq 'rights' and
2873     $cn-><AG::Node.namespaceURI> eq <Q::atom|>) {
2874     $r = $cn;
2875     last E;
2876     }
2877     }
2878    
2879     my $parent = $self-><AG::Node.parentNode>;
2880     if (defined $parent and
2881     $parent-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and
2882     $parent-><AG::Node.namespaceURI> eq <Q::atom|> and
2883     $parent-><AG::Node.localName> eq 'feed') {
2884     for my $cn (@{$parent-><AG::Node.childNodes>}) {
2885     if ($cn-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE> and
2886     $cn-><AG::Node.localName> eq 'rights' and
2887     $cn-><AG::Node.namespaceURI> eq <Q::atom|>) {
2888     $r = $cn;
2889     last E;
2890     }
2891     }
2892     }
2893    
2894     my $od = $self-><AG::Node.ownerDocument>;
2895     if ($od-><AG::Document.domConfig>
2896     -><M::CFG.getParameter> (<Q::cfg|create-child-element>)) {
2897     $r = $od-><M::Document.createElementNS> (<Q::atom|>, 'rights');
2898     $self-><M::Node.appendChild> ($r);
2899     }
2900     } # E
2901     }__;
2902    
2903     @@Test:
2904     @@@QName: AtomEntryElement.entryRightsElement.1.test
2905     @@@PerlDef:
2906     my $doc;
2907     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
2908    
2909     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'entry');
2910    
2911     $test->id ('no');
2912     my $rights = $el-><AG::AtomEntryElement.entryRightsElement>;
2913     $test->assert_null ($rights);
2914    
2915     $doc-><AG::Document.domConfig>
2916     -><M::CFG.setParameter> (<Q::cfg|create-child-element> => true);
2917    
2918     $rights = $el-><AG::AtomEntryElement.entryRightsElement>;
2919    
2920     $test->id ('created.namespaceURI');
2921     $test->assert_equals ($rights-><AG::Node.namespaceURI>, <Q::atom|>);
2922    
2923     $test->id ('created.localName');
2924     $test->assert_equals ($rights-><AG::Node.localName>, 'rights');
2925    
2926     $test->id ('created.parentNode');
2927     $test->assert_equals ($rights-><AG::Node.parentNode>, $el);
2928    
2929     $test->id ('get');
2930     my $rights2 = $el-><AG::AtomEntryElement.entryRightsElement>;
2931     $test->assert_equals ($rights2, $rights);
2932     @@Test:
2933     @@@QName: AtomEntryElement.entryRightsElement.2.test
2934     @@@PerlDef:
2935     my $doc;
2936     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
2937    
2938     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'entry');
2939    
2940     my $feed = $doc-><M::Document.createElementNS> (<Q::atom|>, 'feed');
2941     $feed-><M::Node.appendChild> ($el);
2942     my $rights = $doc-><M::Document.createElementNS> (<Q::atom|>, 'rights');
2943     $feed-><M::Node.appendChild> ($rights);
2944    
2945     $test->id ('get');
2946     my $rights2 = $el-><AG::AtomEntryElement.entryRightsElement>;
2947     $test->assert_equals ($rights2, $rights);
2948    
2949     @Attr:
2950     @@Name: sourceElement
2951     @@enDesc:
2952     The <XE::atom|source> child element of the node.
2953     @@Type: AtomSourceElement
2954     @@Get:
2955     @@@enDesc:
2956     It <kwd:MUST> <I::return a <XE::atom|source> child element>
2957     of the node.
2958     @@@nullCase:
2959     @@@@enDesc:
2960     If the algorithm returns <DOM::null>.
2961     @@@NodeReadOnlyError:
2962     @@@PerlDef:
2963     __CODE{returnChildElement::
2964     $node => $self,
2965     $namespaceURI => {<Q::atom|>},
2966     $localName => 'source',
2967     $r => $r,
2968     }__;
2969    
2970     @Attr:
2971     @@Name: summaryElement
2972     @@enDesc:
2973     The <XE::atom|summary> child element of the node.
2974     @@Type: AtomSummaryElement
2975     @@Get:
2976     @@@enDesc:
2977     It <kwd:MUST> <I::return a <XE::atom|summary> child element>
2978     of the node.
2979     @@@nullCase:
2980     @@@@enDesc:
2981     If the algorithm returns <DOM::null>.
2982     @@@NodeReadOnlyError:
2983     @@@PerlDef:
2984     __CODE{returnChildElement::
2985     $node => $self,
2986     $namespaceURI => {<Q::atom|>},
2987     $localName => 'summary',
2988     $r => $r,
2989     }__;
2990    
2991     @Attr:
2992     @@Name: titleElement
2993     @@enDesc:
2994     The <XE::atom|title> child element of the node.
2995     @@Type: AtomTitleElement
2996     @@Get:
2997     @@@enDesc:
2998     It <kwd:MUST> <I::return a <XE::atom|title> child element>
2999     of the node.
3000     @@@nullCase:
3001     @@@@enDesc:
3002     If the algorithm returns <DOM::null>.
3003     @@@NodeReadOnlyError:
3004     @@@disDef:
3005     @@@@dlp:cloneCode: ManakaiAtomFeedElement.titleElement.get
3006    
3007     @Attr:
3008     @@Name: updatedElement
3009     @@enDesc:
3010     The <XE::atom|updated> child element of the node.
3011     @@Type: AtomUpdatedElement
3012     @@Get:
3013     @@@enDesc:
3014     It <kwd:MUST> <I::return a <XE::atom|updated> child element>
3015     of the node.
3016     @@@nullCase:
3017     @@@@enDesc:
3018     If the algorithm returns <DOM::null>.
3019     @@@NodeReadOnlyError:
3020     @@@disDef:
3021     @@@@dlp:cloneCode: ManakaiAtomFeedElement.updatedElement.get
3022     ##AtomEntryElement
3023    
3024     IFClsETDef:
3025     @IFQName: AtomContentElement
3026     @ETQName: atom|content
3027     @ClsQName: ManakaiAtomContentElement
3028    
3029     @IFISA: AtomElement
3030     @ClsISA: ManakaiAtomElement
3031    
3032     @enDesc:
3033     The <XE::atom|content> element either contains or links to
3034     the content of the entry.
3035    
3036     @Attr:
3037     @@Name: type
3038     @@enDesc:
3039     The type of the element.
3040    
3041     It <kwd:MUST> <I::reflect the string value
3042     of the <XA::type> attribute> of the node. It default
3043     value <kwd:MUST> be <CODE::text> if and only if
3044     there is no <XA::src> attribute on the node.
3045     @@Type: DOMString
3046     @@Get:
3047     @@@nullCase:
3048     @@@@enDesc:
3049     If the algorithm returns <DOM::null>.
3050     @@@PerlDef:
3051     __CODE{getReflectAttrStringValue::
3052     $node => $self,
3053     $namespaceURI => {null},
3054     $localName => 'type',
3055     $r => $r,
3056     $defaultValue => {
3057     $self-><M::Element.hasAttributeNS> (null, 'src') ? null : 'text'
3058     },
3059     }__;
3060     @@Set:
3061     @@@nullCase:
3062     @@@@enDesc:
3063     Removes the attribute.
3064     @@@NodeReadOnlyError:
3065     @@@PerlDef:
3066     __CODE{setReflectAttrStringValue::
3067     $node => $self,
3068     $namespaceURI => {null},
3069     $localName => 'type',
3070     $given => $given,
3071     }__;
3072    
3073     @@Test:
3074     @@@QName: AtomContentElement.type.test
3075     @@@PerlDef:
3076     my $doc;
3077     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
3078    
3079     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'content');
3080    
3081     $test->id ('default.no.src');
3082     $test->assert_equals ($el-><AG::AtomContentElement.type>, 'text');
3083    
3084     $test->id ('default.src');
3085     $el-><AS::AtomContentElement.src> ('http://atom.example/');
3086     $test->assert_null ($el-><AG::AtomContentElement.type>);
3087    
3088     $test->id ('set.xhtml');
3089     $el-><AS::AtomContentElement.type> ('xhtml');
3090     $test->assert_equals ($el-><AG::AtomContentElement.type>, 'xhtml');
3091    
3092     $test->id ('set.imt');
3093     $el-><AS::AtomContentElement.type> ('application/xml');
3094     $test->assert_equals ($el-><AG::AtomContentElement.type>,
3095     'application/xml');
3096    
3097     $test->id ('remove');
3098     $el-><AS::AtomContentElement.type> (null);
3099     $test->assert_null ($el-><AG::AtomContentElement.type>);
3100    
3101     @Attr:
3102     @@Name: src
3103     @@enDesc:
3104     The source of the remote content of the element.
3105    
3106     It <kwd:MUST> <I::reflect the string value
3107     of the <XA::src> attribute> of the node.
3108     @@Type: DOMString
3109     @@Type: DOMURI
3110     @@Get:
3111     @@@nullCase:
3112     @@@@enDesc:
3113     If the algorithm returns <DOM::null>.
3114     @@@PerlDef:
3115     __CODE{getReflectAttrURIValue::
3116     $node => $self,
3117     $namespaceURI => {null},
3118     $localName => 'src',
3119     $r => $r,
3120     $defaultValue => {null},
3121     }__;
3122     @@Set:
3123     @@@nullCase:
3124     @@@@enDesc:
3125     Removes the attribute.
3126     @@@NodeReadOnlyError:
3127     @@@PerlDef:
3128     __CODE{setReflectAttrURIValue::
3129     $node => $self,
3130     $namespaceURI => {null},
3131     $localName => 'src',
3132     $given => $given,
3133     }__;
3134    
3135     @@Test:
3136     @@@QName: AtomContentElement.src.test
3137     @@@PerlDef:
3138     my $doc;
3139     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
3140    
3141     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'content');
3142    
3143     $test->id ('default');
3144     $test->assert_null ($el-><AG::AtomContentElement.src>);
3145    
3146     $test->id ('set');
3147     $el-><AS::AtomContentElement.src> ('http://atom.example/');
3148     $test->assert_equals ($el-><AG::AtomContentElement.src>,
3149     'http://atom.example/');
3150    
3151     $test->id ('set.relative');
3152     $el-><AS::AtomContentElement.src> ('atom');
3153     $test->assert_equals ($el-><AG::AtomContentElement.src>, 'atom');
3154    
3155     $test->id ('set.relative.base');
3156     $el-><M::Element.setAttributeNS> (<Q::xml|>, 'xml:base',
3157     'http://atom.example/');
3158     $test->assert_equals ($el-><AG::AtomContentElement.src>,
3159     'http://atom.example/atom');
3160    
3161     $test->id ('remove');
3162     $el-><AS::AtomContentElement.src> (null);
3163     $test->assert_null ($el-><AG::AtomContentElement.src>);
3164    
3165     @Attr:
3166     @@Name: container
3167     @@enDesc:
3168     The container element that contains the actual content for the node.
3169     @@Type: Element
3170     @@Get:
3171     @@@enDesc:
3172     - If the <A::AtomContentElement.type> is <CODE::xhtml>,
3173     it <kwd:MUST> <I::return the <XE::html|div> child element>.
3174    
3175     - Otherwise, if the <A::AtomContentElement.src> is <DOM::null>,
3176     it <kwd:MUST> return <DOM::null>.
3177    
3178     - Otherwise, it <kwd:MUST> return the node itself.
3179     @@@nullCase:
3180     @@@@enDesc:
3181     If the algorithm returns <DOM::null>.
3182     @@@NodeReadOnlyError:
3183     @@@PerlDef:
3184     __DEEP{
3185     my $type = $self-><AG::AtomContentElement.type>;
3186     if (defined $type and $type eq 'xhtml') {
3187     __UNDEEP{
3188     __CODE{returnChildElement::
3189     $node => $self,
3190     $namespaceURI => {<Q::html|>},
3191     $localName => 'div',
3192     $r => $r,
3193     }__;
3194     }__;
3195     } elsif (not $self-><M::Element.hasAttributeNS> (null, 'src')) {
3196     $r = $self;
3197     }
3198     }__;
3199    
3200     @@Test:
3201     @@@QName: AtomContentElement.container.1.test
3202     @@@PerlDef:
3203     my $doc;
3204     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
3205    
3206     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'content');
3207    
3208     $test->id ('no');
3209     $test->assert_equals ($el-><AG::AtomContentElement.container>, $el);
3210    
3211     $test->id ('application/smil');
3212     $el-><AS::AtomContentElement.type> ('application/smil');
3213     $test->assert_equals ($el-><AG::AtomContentElement.container>, $el);
3214    
3215     $test->id ('text');
3216     $el-><AS::AtomContentElement.type> ('text');
3217     $test->assert_equals ($el-><AG::AtomContentElement.container>, $el);
3218    
3219     $test->id ('html');
3220     $el-><AS::AtomContentElement.type> ('html');
3221     $test->assert_equals ($el-><AG::AtomContentElement.container>, $el);
3222    
3223     $test->id ('xhtml');
3224     $el-><AS::AtomContentElement.type> ('xhtml');
3225     $test->assert_null ($el-><AG::AtomContentElement.container>);
3226    
3227     $doc-><AG::Document.domConfig>
3228     -><M::CFG.setParameter> (<Q::cfg|create-child-element> => true);
3229     my $con = $el-><AG::AtomContentElement.container>;
3230    
3231     $test->id ('xhtml.create');
3232     $test->assert_not_equals ($con, $el);
3233    
3234     $test->id ('xhtml.namespaceURI');
3235     $test->assert_equals ($con-><AG::Node.namespaceURI>, <Q::html|>);
3236    
3237     $test->id ('xhtml.localName');
3238     $test->assert_equals ($con-><AG::Node.localName>, 'div');
3239    
3240     $test->id ('xhtml.parentNode');
3241     $test->assert_equals ($con-><AG::Node.parentNode>, $el);
3242    
3243     $test->id ('xhtml.2');
3244     $test->assert_equals ($el-><AG::AtomContentElement.container>, $con);
3245     @@Test:
3246     @@@QName: AtomContentElement.container.2.test
3247     @@@enDesc:
3248     With <XA::src>.
3249     @@@PerlDef:
3250     my $doc;
3251     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
3252    
3253     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'content');
3254    
3255     $el-><AS::AtomContentElement.src> ('http://www.example.com/');
3256    
3257     $test->id ('no');
3258     $test->assert_null ($el-><AG::AtomContentElement.container>);
3259    
3260     $test->id ('application/smil');
3261     $el-><AS::AtomContentElement.type> ('application/smil');
3262     $test->assert_null ($el-><AG::AtomContentElement.container>);
3263    
3264     @enImplNote:
3265     @@ddid: base64
3266     @@@:
3267     {TODO::
3268     Access to Base64'ed content is necessary.
3269     }
3270     ##AtomContentElement
3271    
3272     IFClsETDef:
3273     @IFQName: AtomAuthorElement
3274     @ETQName: atom|author
3275     @ClsQName: ManakaiAtomAuthorElement
3276    
3277     @IFISA: AtomPersonConstruct
3278     @ClsISA: ManakaiAtomPersonConstruct
3279    
3280     @enDesc:
3281     The <XE::atom|author> element is a Person construct that
3282     indicates the author of the entry or feed.
3283     ##AtomAuthorElement
3284    
3285     IFClsETDef:
3286     @IFQName: AtomCategoryElement
3287     @ETQName: atom|category
3288     @ClsQName: ManakaiAtomCategoryElement
3289    
3290     @IFISA: AtomElement
3291     @ClsISA: ManakaiAtomElement
3292    
3293     @enDesc:
3294     The <XE::atom|category> element conveys information abut
3295     a category associated with an entry or feed.
3296    
3297     @Attr:
3298     @@Name: term
3299     @@enDesc:
3300     The <XA::term> attribute of the element.
3301    
3302     It <kwd:MUST> <I::reflect the string value
3303     of the <XA::term> attribute> of the node.
3304     @@Type: DOMString
3305     @@Get:
3306     @@@nullCase:
3307     @@@@enDesc:
3308     If the algorithm returns <DOM::null>.
3309     @@@PerlDef:
3310     __CODE{getReflectAttrStringValue::
3311     $node => $self,
3312     $namespaceURI => {null},
3313     $localName => 'term',
3314     $r => $r,
3315     $defaultValue => {null},
3316     }__;
3317     @@Set:
3318     @@@nullCase:
3319     @@@@enDesc:
3320     Removes the attribute.
3321     @@@NodeReadOnlyError:
3322     @@@PerlDef:
3323     __CODE{setReflectAttrStringValue::
3324     $node => $self,
3325     $namespaceURI => {null},
3326     $localName => 'term',
3327     $given => $given,
3328     }__;
3329    
3330     @Attr:
3331     @@Name: scheme
3332     @@enDesc:
3333     The categorization scheme of the element.
3334    
3335     It <kwd:MUST> <I::reflect the URI value
3336     of the <XA::scheme> attribute> of the node.
3337     @@Type: DOMString
3338     @@Type: DOMURI
3339     @@Get:
3340     @@@nullCase:
3341     @@@@enDesc:
3342     If the algorithm returns <DOM::null>.
3343     @@@PerlDef:
3344     __CODE{getReflectAttrURIValue::
3345     $node => $self,
3346     $namespaceURI => {null},
3347     $localName => 'scheme',
3348     $r => $r,
3349     $defaultValue => {null},
3350     }__;
3351     @@Set:
3352     @@@nullCase:
3353     @@@@enDesc:
3354     Removes the attribute.
3355     @@@NodeReadOnlyError:
3356     @@@PerlDef:
3357     __CODE{setReflectAttrURIValue::
3358     $node => $self,
3359     $namespaceURI => {null},
3360     $localName => 'scheme',
3361     $given => $given,
3362     }__;
3363    
3364     @Attr:
3365     @@Name: label
3366     @@enDesc:
3367     The <XA::label> attribute of the element.
3368    
3369     It <kwd:MUST> <I::reflect the string value
3370     of the <XA::label> attribute> of the node.
3371     @@Type: DOMString
3372     @@Get:
3373     @@@nullCase:
3374     @@@@enDesc:
3375     If the algorithm returns <DOM::null>.
3376     @@@PerlDef:
3377     __CODE{getReflectAttrStringValue::
3378     $node => $self,
3379     $namespaceURI => {null},
3380     $localName => 'label',
3381     $r => $r,
3382     $defaultValue => {null},
3383     }__;
3384     @@Set:
3385     @@@nullCase:
3386     @@@@enDesc:
3387     Removes the attribute.
3388     @@@NodeReadOnlyError:
3389     @@@PerlDef:
3390     __CODE{setReflectAttrStringValue::
3391     $node => $self,
3392     $namespaceURI => {null},
3393     $localName => 'label',
3394     $given => $given,
3395     }__;
3396     ##AtomCategoryElement
3397    
3398     IFClsETDef:
3399     @IFQName: AtomContributorElement
3400     @ETQName: atom|contributor
3401     @ClsQName: ManakaiAtomContributorElement
3402    
3403     @IFISA: AtomPersonConstruct
3404     @ClsISA: ManakaiAtomPersonConstruct
3405    
3406     @enDesc:
3407     The <XE::atom|contributor> element is a Person construct that
3408     indicates a person or other entity who contributed to the entry
3409     or feed.
3410     ##AtomContributorElement
3411    
3412     IFClsETDef:
3413     @IFQName: AtomGeneratorElement
3414     @ETQName: atom|generator
3415     @ClsQName: ManakaiAtomGeneratorElement
3416    
3417     @IFISA: AtomElement
3418     @ClsISA: ManakaiAtomElement
3419    
3420     @enDesc:
3421     The <XE::atom|generator> element identifies the agent used
3422     to generate a feed.
3423    
3424     @Attr:
3425     @@Name: uri
3426     @@enDesc:
3427     The URI attribute of the element.
3428    
3429     It <kwd:MUST> <I::reflect the URI value
3430     of the <XA::uri> attribute> of the node.
3431     @@Type: DOMString
3432     @@Type: DOMURI
3433     @@Get:
3434     @@@nullCase:
3435     @@@@enDesc:
3436     If the algorithm returns <DOM::null>.
3437     @@@PerlDef:
3438     __CODE{getReflectAttrURIValue::
3439     $node => $self,
3440     $namespaceURI => {null},
3441     $localName => 'uri',
3442     $r => $r,
3443     $defaultValue => {null},
3444     }__;
3445     @@Set:
3446     @@@nullCase:
3447     @@@@enDesc:
3448     Removes the attribute.
3449     @@@NodeReadOnlyError:
3450     @@@PerlDef:
3451     __CODE{setReflectAttrURIValue::
3452     $node => $self,
3453     $namespaceURI => {null},
3454     $localName => 'uri',
3455     $given => $given,
3456     }__;
3457    
3458     @Attr:
3459     @@Name: version
3460     @@enDesc:
3461     The <XA::version> attribute of the element.
3462    
3463     It <kwd:MUST> <I::reflect the string value
3464     of the <XA::version> attribute> of the node.
3465     @@Type: DOMString
3466     @@Get:
3467     @@@nullCase:
3468     @@@@enDesc:
3469     If the algorithm returns <DOM::null>.
3470     @@@PerlDef:
3471     __CODE{getReflectAttrStringValue::
3472     $node => $self,
3473     $namespaceURI => {null},
3474     $localName => 'version',
3475     $r => $r,
3476     $defaultValue => {null},
3477     }__;
3478     @@Set:
3479     @@@nullCase:
3480     @@@@enDesc:
3481     Removes the attribute.
3482     @@@NodeReadOnlyError:
3483     @@@PerlDef:
3484     __CODE{setReflectAttrStringValue::
3485     $node => $self,
3486     $namespaceURI => {null},
3487     $localName => 'version',
3488     $given => $given,
3489     }__;
3490     ##AtomGeneratorElement
3491    
3492     IFClsETDef:
3493     @IFQName: AtomLinkElement
3494     @ETQName: atom|link
3495     @ClsQName: ManakaiAtomLinkElement
3496    
3497     @IFISA: AtomElement
3498     @ClsISA: ManakaiAtomElement
3499    
3500     @enDesc:
3501     The <XE::atom|link> element defines a reference from an entry
3502     or feed to a Web resource.
3503    
3504     @Attr:
3505     @@Name: href
3506     @@enDesc:
3507     The <XA::href> attribute of the element.
3508    
3509     It <kwd:MUST> <I::reflect the URI value
3510     of the <XA::href> attribute> of the node.
3511     @@Type: DOMString
3512     @@Type: DOMURI
3513     @@Get:
3514     @@@nullCase:
3515     @@@@enDesc:
3516     If the algorithm returns <DOM::null>.
3517     @@@PerlDef:
3518     __CODE{getReflectAttrURIValue::
3519     $node => $self,
3520     $namespaceURI => {null},
3521     $localName => 'href',
3522     $r => $r,
3523     $defaultValue => {null},
3524     }__;
3525     @@Set:
3526     @@@nullCase:
3527     @@@@enDesc:
3528     Removes the attribute.
3529     @@@NodeReadOnlyError:
3530     @@@PerlDef:
3531     __CODE{setReflectAttrURIValue::
3532     $node => $self,
3533     $namespaceURI => {null},
3534     $localName => 'href',
3535     $given => $given,
3536     }__;
3537    
3538     @Attr:
3539     @@Name: rel
3540     @@enDesc:
3541     The <XA::rel> attribute of the element.
3542    
3543     It <kwd:MUST> <I::reflect the string value
3544     of the <XA::rel> attribute> of the node, with
3545     a few exceptions. The default value <kwd:MUST>
3546     be <URI^DISCore|QName::rel|alternate>.
3547     @@Type: DOMString
3548     @@Get:
3549     @@@enDesc:
3550     If the algorithm returns a string that does not contain
3551     any <CHAR::COLON> character, the string
3552     <URI^DISCore|QName::rel|> <kwd:MUST> be prepended
3553     for the return value of the getter.
3554     @@@PerlDef:
3555     __CODE{getReflectAttrStringValue::
3556     $node => $self,
3557     $namespaceURI => {null},
3558     $localName => 'rel',
3559     $r => $r,
3560     $defaultValue => {<Q::rel|alternate>},
3561     }__;
3562     if (defined $r and index ($r, ':') == -1) {
3563     $r = <Q::rel|> . $r;
3564     }
3565     @@Set:
3566     @@@enDesc:
3567     If the given value starts with <URI^DISCore|QName::rel|> (by
3568     simple character-by-character comparison), such substring
3569     <kwd:MUST> be removed for the purpose of the setter algorithm,
3570     if and only if the result string is not empty and does contain
3571     none of <CHAR::COLON>, <CHAR::SOLIDUS>, <CHAR::QUESTION MARK>,
3572     and <CHAR::NUMBER SIGN>.
3573     @@@nullCase:
3574     @@@@enDesc:
3575     Removes the attribute.
3576     @@@NodeReadOnlyError:
3577     @@@PerlDef:
3578     if (defined $given) {
3579     $given =~ s[\Ahttp://www.iana.org/assignments/relation/([^:/?#]+)\z]
3580     [$1];
3581     }
3582     __CODE{setReflectAttrStringValue::
3583     $node => $self,
3584     $namespaceURI => {null},
3585     $localName => 'rel',
3586     $given => $given,
3587     }__;
3588    
3589     @@Test:
3590     @@@QName: AtomLinkElement.rel.test
3591     @@@PerlDef:
3592     my $doc;
3593     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
3594    
3595     my $el = $doc-><M::Document.createElementNS> (<Q::atom|>, 'link');
3596    
3597     $test->id ('default');
3598     $test->assert_equals ($el-><AG::AtomLinkElement.rel>,
3599     <Q::rel|alternate>);
3600    
3601     $test->id ('set');
3602     $el-><AS::AtomLinkElement.rel> ('http://www.example.com/');
3603     $test->assert_equals ($el-><AG::AtomLinkElement.rel>,
3604     'http://www.example.com/');
3605    
3606     $test->id ('set.self');
3607     $el-><AS::AtomLinkElement.rel> ('self');
3608     $test->assert_equals ($el-><AG::AtomLinkElement.rel>,
3609     <Q::rel|self>);
3610    
3611     $test->id ('set.qrelated');
3612     $el-><AS::AtomLinkElement.rel> (<Q::rel|related>);
3613     $test->assert_equals ($el-><AG::AtomLinkElement.rel>,
3614     <Q::rel|related>);
3615    
3616     $test->id ('remove');
3617     $el-><AS::AtomLinkElement.rel> (null);
3618     $test->assert_equals ($el-><AG::AtomLinkElement.rel>,
3619     <Q::rel|alternate>);
3620    
3621     @Attr:
3622     @@Name: type
3623     @@enDesc:
3624     The <XA::type> attribute of the element.
3625    
3626     It <kwd:MUST> <I::reflect the string value
3627     of the <XA::type> attribute> of the node.
3628     @@Type: DOMString
3629     @@Get:
3630     @@@nullCase:
3631     @@@@enDesc:
3632     If the algorithm returns <DOM::null>.
3633     @@@PerlDef:
3634     __CODE{getReflectAttrStringValue::
3635     $node => $self,
3636     $namespaceURI => {null},
3637     $localName => 'type',
3638     $r => $r,
3639     $defaultValue => {null},
3640     }__;
3641     @@Set:
3642     @@@nullCase:
3643     @@@@enDesc:
3644     Removes the attribute.
3645     @@@NodeReadOnlyError:
3646     @@@PerlDef:
3647     __CODE{setReflectAttrStringValue::
3648     $node => $self,
3649     $namespaceURI => {null},
3650     $localName => 'type',
3651     $given => $given,
3652     }__;
3653    
3654     @Attr:
3655     @@Name: hreflang
3656     @@enDesc:
3657     The <XA::hreflang> attribute of the element.
3658    
3659     It <kwd:MUST> <I::reflect the string value
3660     of the <XA::hreflang> attribute> of the node.
3661     @@Type: DOMString
3662     @@Get:
3663     @@@nullCase:
3664     @@@@enDesc:
3665     If the algorithm returns <DOM::null>.
3666     @@@PerlDef:
3667     __CODE{getReflectAttrStringValue::
3668     $node => $self,
3669     $namespaceURI => {null},
3670     $localName => 'hreflang',
3671     $r => $r,
3672     $defaultValue => {null},
3673     }__;
3674     @@Set:
3675     @@@nullCase:
3676     @@@@enDesc:
3677     Removes the attribute.
3678     @@@NodeReadOnlyError:
3679     @@@PerlDef:
3680     __CODE{setReflectAttrStringValue::
3681     $node => $self,
3682     $namespaceURI => {null},
3683     $localName => 'hreflang',
3684     $given => $given,
3685     }__;
3686    
3687     @Attr:
3688     @@Name: title
3689     @@enDesc:
3690     The <XA::title> attribute of the element.
3691    
3692     It <kwd:MUST> <I::reflect the string value
3693     of the <XA::title> attribute> of the node.
3694     @@Type: DOMString
3695     @@Get:
3696     @@@nullCase:
3697     @@@@enDesc:
3698     If the algorithm returns <DOM::null>.
3699     @@@PerlDef:
3700     __CODE{getReflectAttrStringValue::
3701     $node => $self,
3702     $namespaceURI => {null},
3703     $localName => 'title',
3704     $r => $r,
3705     $defaultValue => {null},
3706     }__;
3707     @@Set:
3708     @@@nullCase:
3709     @@@@enDesc:
3710     Removes the attribute.
3711     @@@NodeReadOnlyError:
3712     @@@PerlDef:
3713     __CODE{setReflectAttrStringValue::
3714     $node => $self,
3715     $namespaceURI => {null},
3716     $localName => 'title',
3717     $given => $given,
3718     }__;
3719    
3720     @Attr:
3721     @@Name: length
3722     @@enDesc:
3723     The <XA::length> attribute of the element.
3724    
3725     It <kwd:MUST> <I::reflect the string value
3726     of the <XA::length> attribute> of the node.
3727     @@Type: DOMString
3728     @@Get:
3729     @@@nullCase:
3730     @@@@enDesc:
3731     If the algorithm returns <DOM::null>.
3732     @@@PerlDef:
3733     __CODE{getReflectAttrStringValue::
3734     $node => $self,
3735     $namespaceURI => {null},
3736     $localName => 'length',
3737     $r => $r,
3738     $defaultValue => {null},
3739     }__;
3740     @@Set:
3741     @@@nullCase:
3742     @@@@enDesc:
3743     Removes the attribute.
3744     @@@NodeReadOnlyError:
3745     @@@PerlDef:
3746     __CODE{setReflectAttrStringValue::
3747     $node => $self,
3748     $namespaceURI => {null},
3749     $localName => 'length',
3750     $given => $given,
3751     }__;
3752     ##AtomLinkElement
3753    
3754     IFClsETDef:
3755     @IFQName: AtomPublishedElement
3756     @ETQName: atom|published
3757     @ClsQName: ManakaiAtomPublishedElement
3758    
3759     @IFISA: AtomDateConstruct
3760     @ClsISA: ManakaiAtomDateConstruct
3761    
3762     @enDesc:
3763     The <XE::atom|published> element is a Date construct
3764     indicating an instant in time associated with an
3765     event early in the life cycle of the entry.
3766    
3767     Typically, <XE::atom|published> will be associated with
3768     the initial creation or first availability of the resouce.
3769     ##AtomPublishedElement
3770    
3771     IFClsETDef:
3772     @IFQName: AtomRightsElement
3773     @ETQName: atom|rights
3774     @ClsQName: ManakaiAtomRightsElement
3775    
3776     @IFISA: AtomTextConstruct
3777     @ClsISA: ManakaiAtomTextConstruct
3778    
3779     @enDesc:
3780     The <XE::atom|rights> element is a Text construct
3781     that conveys information about rights held in and
3782     over an entry or feed.
3783     ##AtomRightsElement
3784    
3785     IFClsETDef:
3786     @IFQName: AtomSourceElement
3787     @ETQName: atom|source
3788     @ClsQName: ManakaiAtomSourceElement
3789    
3790     @IFISA: AtomElement
3791     @ClsISA: ManakaiAtomElement
3792    
3793     @Attr:
3794     @@Name: authorElements
3795     @@enDesc:
3796     A static list of <XE::atom|author> child elements of the node.
3797     @@Type: StaticNodeList
3798     @@Get:
3799     @@@enDesc:
3800     It <kwd:MUST> <I::return a <XE::atom|author> child element list>
3801     of the node.
3802     @@@disDef:
3803     @@@@dlp:cloneCode: ManakaiAtomFeedElement.authorElements.get
3804    
3805     @Attr:
3806     @@Name: categoryElements
3807     @@enDesc:
3808     A static list of <XE::atom|category> child elements of the node.
3809     @@Type: StaticNodeList
3810     @@Get:
3811     @@@enDesc:
3812     It <kwd:MUST> <I::return a <XE::atom|category> child element list>
3813     of the node.
3814     @@@disDef:
3815     @@@@dlp:cloneCode: ManakaiAtomFeedElement.categoryElements.get
3816    
3817     @Attr:
3818     @@Name: contributorElements
3819     @@enDesc:
3820     A static list of <XE::atom|contributor> child elements of the node.
3821     @@Type: StaticNodeList
3822     @@Get:
3823     @@@enDesc:
3824     It <kwd:MUST> <I::return a <XE::atom|contributor> child element list>
3825     of the node.
3826     @@@disDef:
3827     @@@@dlp:cloneCode: ManakaiAtomFeedElement.contributorElements.get
3828    
3829     @Attr:
3830     @@Name: generatorElement
3831     @@enDesc:
3832     The <XE::atom|generator> child element of the node.
3833     @@Type: AtomGeneratorElement
3834     @@Get:
3835     @@@enDesc:
3836     It <kwd:MUST> <I::return a <XE::atom|generator> child element>
3837     of the node.
3838     @@@nullCase:
3839     @@@@enDesc:
3840     If the algorithm returns <DOM::null>.
3841     @@@NodeReadOnlyError:
3842     @@@disDef:
3843     @@@@dlp:cloneCode: ManakaiAtomFeedElement.generatorElement.get
3844    
3845     @Attr:
3846     @@Name: icon
3847     @@enDesc:
3848     The <XE::atom|icon> value of the node.
3849    
3850     It <kwd:MUST> <I::reflect the URI value
3851     of the <XE::atom|icon> child element> of the node.
3852     @@Type: DOMString
3853     @@actualType: DOMURI
3854     @@Get:
3855     @@@nullCase:
3856     @@@@enDesc:
3857     If the algorithm returns <DOM::null>.
3858     @@@NodeReadOnlyError:
3859     @@@disDef:
3860     @@@@dlp:cloneCode: ManakaiAtomFeedElement.icon.get
3861     @@Set:
3862     @@@nullCase:
3863     @@@@enDesc:
3864     Removes the value.
3865     @@@NodeReadOnlyError:
3866     @@@disDef:
3867     @@@@dlp:cloneCode: ManakaiAtomFeedElement.icon.set
3868    
3869     @Attr:
3870     @@Name: id
3871     @@enDesc:
3872     The <XE::atom|id> value of the node.
3873    
3874     It <kwd:MUST> <I::reflect the string value
3875     of the <XE::atom|id> child element> of the node.
3876     @@Type: DOMString
3877     @@actualType: DOMURI
3878     @@Get:
3879     @@@nullCase:
3880     @@@@enDesc:
3881     If the algorithm returns <DOM::null>.
3882     @@@NodeReadOnlyError:
3883     @@@disDef:
3884     @@@@dlp:cloneCode: ManakaiAtomFeedElement.id.get
3885     @@Set:
3886     @@@nullCase:
3887     @@@@enDesc:
3888     Removes the value.
3889     @@@NodeReadOnlyError:
3890     @@@disDef:
3891     @@@@dlp:cloneCode: ManakaiAtomFeedElement.id.set
3892    
3893     @Attr:
3894     @@Name: linkElements
3895     @@enDesc:
3896     A static list of <XE::atom|link> child elements of the node.
3897     @@Type: StaticNodeList
3898     @@Get:
3899     @@@enDesc:
3900     It <kwd:MUST> <I::return a <XE::atom|link> child element list>
3901     of the node.
3902     @@@disDef:
3903     @@@@dlp:cloneCode: ManakaiAtomFeedElement.linkElements.get
3904    
3905     @Attr:
3906     @@Name: logo
3907     @@enDesc:
3908     The <XE::atom|logo> value of the node.
3909    
3910     It <kwd:MUST> <I::reflect the URI value
3911     of the <XE::atom|logo> child element> of the node.
3912     @@Type: DOMString
3913     @@actualType: DOMURI
3914     @@Get:
3915     @@@nullCase:
3916     @@@@enDesc:
3917     If the algorithm returns <DOM::null>.
3918     @@@NodeReadOnlyError:
3919     @@@disDef:
3920     @@@@dlp:cloneCode: ManakaiAtomFeedElement.logo.get
3921     @@Set:
3922     @@@nullCase:
3923     @@@@enDesc:
3924     Removes the value.
3925     @@@NodeReadOnlyError:
3926     @@@disDef:
3927     @@@@dlp:cloneCode: ManakaiAtomFeedElement.logo.set
3928    
3929     @Attr:
3930     @@Name: rightsElement
3931     @@enDesc:
3932     The <XE::atom|rights> child element of the node.
3933     @@Type: AtomRightsElement
3934     @@Get:
3935     @@@enDesc:
3936     It <kwd:MUST> <I::return a <XE::atom|rights> child element>
3937     of the node.
3938     @@@nullCase:
3939     @@@@enDesc:
3940     If the algorithm returns <DOM::null>.
3941     @@@NodeReadOnlyError:
3942     @@@disDef:
3943     @@@@dlp:cloneCode: ManakaiAtomFeedElement.rightsElement.get
3944    
3945     @Attr:
3946     @@Name: subtitleElement
3947     @@enDesc:
3948     The <XE::atom|subtitle> child element of the node.
3949     @@Type: AtomSubtitleElement
3950     @@Get:
3951     @@@enDesc:
3952     It <kwd:MUST> <I::return a <XE::atom|subtitle> child element>
3953     of the node.
3954     @@@nullCase:
3955     @@@@enDesc:
3956     If the algorithm returns <DOM::null>.
3957     @@@NodeReadOnlyError:
3958     @@@disDef:
3959     @@@@dlp:cloneCode: ManakaiAtomFeedElement.subtitleElement.get
3960    
3961     @Attr:
3962     @@Name: titleElement
3963     @@enDesc:
3964     The <XE::atom|title> child element of the node.
3965     @@Type: AtomTitleElement
3966     @@Get:
3967     @@@enDesc:
3968     It <kwd:MUST> <I::return a <XE::atom|title> child element>
3969     of the node.
3970     @@@nullCase:
3971     @@@@enDesc:
3972     If the algorithm returns <DOM::null>.
3973     @@@NodeReadOnlyError:
3974     @@@disDef:
3975     @@@@dlp:cloneCode: ManakaiAtomFeedElement.titleElement.get
3976    
3977     @Attr:
3978     @@Name: updatedElement
3979     @@enDesc:
3980     The <XE::atom|updated> child element of the node.
3981     @@Type: AtomUpdatedElement
3982     @@Get:
3983     @@@enDesc:
3984     It <kwd:MUST> <I::return a <XE::atom|updated> child element>
3985     of the node.
3986     @@@nullCase:
3987     @@@@enDesc:
3988     If the algorithm returns <DOM::null>.
3989     @@@NodeReadOnlyError:
3990     @@@disDef:
3991     @@@@dlp:cloneCode: ManakaiAtomFeedElement.updatedElement.get
3992     ##AtomSourceElement
3993    
3994     IFClsETDef:
3995     @IFQName: AtomSubtitleElement
3996     @ETQName: atom|subtitle
3997     @ClsQName: ManakaiAtomSubtitleElement
3998    
3999     @IFISA: AtomTextConstruct
4000     @ClsISA: ManakaiAtomTextConstruct
4001    
4002     @enDesc:
4003     The <XE::atom|subtitle> element is a Text construct
4004     that conveys a human-readable description or subtitle for a feed.
4005     ##AtomSubtitleElement
4006    
4007     IFClsETDef:
4008     @IFQName: AtomSummaryElement
4009     @ETQName: atom|summary
4010     @ClsQName: ManakaiAtomSummaryElement
4011    
4012     @IFISA: AtomTextConstruct
4013     @ClsISA: ManakaiAtomTextConstruct
4014    
4015     @enDesc:
4016     The <XE::atom|summary> element is a Text construct
4017     that conveys a short summary, abstract, or excerpt of an entry.
4018     ##AtomSummaryElement
4019    
4020     IFClsETDef:
4021     @IFQName: AtomTitleElement
4022     @ETQName: atom|title
4023     @ClsQName: ManakaiAtomTitleElement
4024    
4025     @IFISA: AtomTextConstruct
4026     @ClsISA: ManakaiAtomTextConstruct
4027    
4028     @enDesc:
4029     The <XE::atom|title> element is a Text construct
4030     that conveys a human-readable title for an entry or feed.
4031     ##AtomTitleElement
4032    
4033     IFClsETDef:
4034     @IFQName: AtomUpdatedElement
4035     @ETQName: atom|updated
4036     @ClsQName: ManakaiAtomUpdatedElement
4037    
4038     @IFISA: AtomDateConstruct
4039     @ClsISA: ManakaiAtomDateConstruct
4040    
4041     @enDesc:
4042     The <XE::atom|updated> element is a Date construct
4043     indicating the most recent instant in time when an
4044     entry or feed was modified in a way the publisher considers
4045     significant.
4046     ##AtomPublishedElement
4047    
4048     ElementTypeBinding:
4049     @Name: NodeReadOnlyError
4050     @ElementType:
4051     dx:raises
4052     @ShadowContent:
4053     @@@: MDOMX|NOMOD_THIS
4054     @@Description:
4055     @@@lang:en
4056     @@@@:
4057     If the node or a descendant of it, which
4058     is to be modified, is read-only.
4059    
4060     ## -- Configuration Parameters
4061    
4062     boolCParam:
4063     @QName: cfg|create-child-element
4064     @tc:nodeStemKey:
4065     @@@: ccldel
4066     @@ForCheck: =ManakaiDOM|all
4067     @c:targetType: tc|Document
4068     @IsSupportRequired:1
4069     @TrueCase:
4070     @@c:isSupported:1
4071     @@enDesc:
4072     If the parameter is set to <DOM::true>, some DOM attributes
4073     that returns an element will create a child element
4074     when there is no element that met the condition defined
4075     for that DOM attribute.
4076     @FalseCase:
4077     @@c:isSupported:1
4078     @@IsSupportRequired:1
4079     @@IsDefault:1
4080     @@enDesc:
4081     If the parameter is set to <DOM::true>, some DOM attributes
4082     that returns an element will <EM::not> create a child element
4083     even when there is no element that met the condition defined
4084     for that DOM attribute.
4085     @TestC:
4086     @@QName: cfg.create-child-element.set.test
4087     @@PerlCDef:
4088     my $doc;
4089     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
4090    
4091     my $cfg = $doc-><AG::Document.domConfig>;
4092     my $cp = <Q::cfg|create-child-element>;
4093    
4094     $test->id ('default');
4095     $test->assert_false ($cfg-><M::CFG.getParameter> ($cp));
4096    
4097     $test->id ('set.f.to.t');
4098     $cfg-><M::CFG.setParameter> ($cp => true);
4099     $test->assert_true ($cfg-><M::CFG.getParameter> ($cp));
4100    
4101     $test->id ('set.t.to.f');
4102     $cfg-><M::CFG.setParameter> ($cp => false);
4103     $test->assert_false ($cfg-><M::CFG.getParameter> ($cp));
4104    
4105     $cfg-><M::CFG.setParameter> ($cp => true);
4106    
4107     $test->id ('reset');
4108     $cfg-><M::CFG.setParameter> ($cp => null);
4109     $test->assert_false ($cfg-><M::CFG.getParameter> ($cp));
4110    
4111     ResourceDef:
4112     @QName: CFG
4113     @AliasFor: c|DOMConfiguration
4114     @For: ManakaiDOM|DOM3
4115    
4116     ElementTypeBinding:
4117     @Name: boolCParam
4118     @ElementType:
4119     dis:ResourceDef
4120     @ShadowContent:
4121     @@DISCore:resourceType:
4122     @@@@: c|DOMConfigurationParameter
4123     @@@For: ManakaiDOM|DOM
4124     @@DISCore:resourceType:
4125     @@@@: DISCore|Property
4126     @@@For: =ManakaiDOM|all
4127     @@For: ManakaiDOM|DOM3
4128     @@For: =ManakaiDOM|all
4129     @@Type: idl|boolean||ManakaiDOM|all

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24