/[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.20 - (hide annotations) (download)
Fri Dec 29 14:45:44 2006 UTC (17 years, 4 months ago) by wakaba
Branch: MAIN
Changes since 1.19: +5 -1 lines
++ manakai/t/ChangeLog	29 Dec 2006 13:56:36 -0000
2006-12-29  Wakaba  <wakaba@suika.fam.cx>

	* .cvsignore: New auto-generated Perl test files
	are added.

++ manakai/lib/Message/Util/ChangeLog	29 Dec 2006 13:53:51 -0000
2006-12-29  Wakaba  <wakaba@suika.fam.cx>

	* PerlCode.dis (createPCFile): Removed.
	(createPCDocument): New method.

++ manakai/lib/Message/Util/DIS/ChangeLog	29 Dec 2006 13:54:30 -0000
2006-12-29  Wakaba  <wakaba@suika.fam.cx>

	* Perl.dis (plGeneratePerlModuleFile): Removed.
	(plGeneratePerlModuleDocument): New method.

++ manakai/lib/Message/DOM/ChangeLog	29 Dec 2006 13:53:21 -0000
2006-12-29  Wakaba  <wakaba@suika.fam.cx>

	* TreeCore.dis, DOMCore.dis, Document.dis,
	Element.dis, CharacterData.dis, XML.dis,
	XDoctype.dis, DOMString.dis, TreeStore.dis,
	XMLParser.dis: Use Perl native
	hashs and |Scalar::Util|'s weak references in favor of |Grove.dis|
	for DOM nodes.  See
	also <http://suika.fam.cx/gate/2005/sw/manakai/%E3%83%A1%E3%83%A2/2006-12-29>.

++ manakai/lib/manakai/ChangeLog	29 Dec 2006 13:56:06 -0000
2006-12-29  Wakaba  <wakaba@suika.fam.cx>

	* daf-perl-pm.pl: Use |pl_generate_perl_module_document|
	instead of |pl_generate_perl_module_file|.

	* daf-perl-t.pl: Use |create_pc_document|
	instead of |create_pc_file|.
	(daf_generate_perl_test_file|: Removed.
	(daf_generate_perl_test_document|: New function.

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24