/[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.5 - (hide annotations) (download)
Sat May 20 05:11:37 2006 UTC (17 years, 11 months ago) by wakaba
Branch: MAIN
Changes since 1.4: +2 -1 lines
++ manakai/bin/ChangeLog	20 May 2006 05:09:42 -0000
2006-05-20  Wakaba  <wakaba@suika.fam.cx>

	* daf.pl ($VERSION): New variable.
	(--mod-file-suffix): New option.

	(--create-dtd-modules): New option.4a
++ manakai/lib/Message/Markup/ChangeLog	20 May 2006 05:10:32 -0000
2006-05-20  Wakaba  <wakaba@suika.fam.cx>

	* Atom.dis (Atom): The |mv:vid| property is added.

++ manakai/lib/Message/DOM/ChangeLog	20 May 2006 05:10:10 -0000
2006-05-20  Wakaba  <wakaba@suika.fam.cx>

	* XDP.dis (createXDPIf): New method.
	(XDPIfElement): New interface.

++ manakai/lib/manakai/ChangeLog	20 May 2006 05:11:24 -0000
2006-05-20  Wakaba  <wakaba@suika.fam.cx>

	* DISMarkup.dis (mv:vid, mv:shortDescription): New properties.

	* daf-dtd-modules.pl: DTD module file generation and
	element type declaration generation are implemented.

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24