/[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.12 - (hide annotations) (download)
Thu Sep 7 07:25:29 2006 UTC (17 years, 8 months ago) by wakaba
Branch: MAIN
Changes since 1.11: +6 -1 lines
++ manakai/lib/Message/Markup/ChangeLog	7 Sep 2006 07:25:15 -0000
2006-09-07  Wakaba  <wakaba@suika.fam.cx>

	* Atom.dis (addNewEntry): The new element was not
	appended to the element.

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24