/[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.24 - (hide annotations) (download)
Sat Dec 30 13:25:34 2006 UTC (17 years, 3 months ago) by wakaba
Branch: MAIN
CVS Tags: manakai-release-0-4-0, HEAD
Changes since 1.23: +3 -4 lines
++ manakai/lib/Message/Util/DIS/ChangeLog	30 Dec 2006 13:23:58 -0000
	* Perl.dis (plCodeFragment): Support for |f:provides|
	is removed.

2006-12-30  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/Message/DOM/ChangeLog	30 Dec 2006 13:22:55 -0000
	* DOMFeature.dis (ForDef): Removed.
	(f:provides, f:through): Removed.
	(Version): Removed.
	(implementFeature): Removed.

2006-12-30  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/manakai/ChangeLog	30 Dec 2006 13:25:24 -0000
	* DISIDL.dis, Java.dis, ECMAScript.dis,
	Document.dis, DISPerl.dis, XML.dis (ForDef): Removed.

	* DISMarkup.dis (ForET): Removed.

	* |DefaultFor| properties are removed.

	* DISCore.dis (DefaultFor): Removed.

2006-12-30  Wakaba  <wakaba@suika.fam.cx>

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24