/[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.23 - (hide annotations) (download)
Sat Dec 30 12:00:41 2006 UTC (17 years, 3 months ago) by wakaba
Branch: MAIN
Changes since 1.22: +15 -17 lines
++ manakai/lib/Message/Markup/ChangeLog	30 Dec 2006 11:55:48 -0000
	* Atom.dis, SuikaWiki.dis, H2H.dis, SuikaWikiConfig21.dis: |For|
	specifications are removed.

	* SuikaWikiConfig21.dis: |WithFor| and |DefaultFor|
	specifications are removed.
	(ForEmpty, ForLatest): Removed.

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

++ manakai/lib/Message/Util/ChangeLog	30 Dec 2006 11:57:42 -0000
	* PerlCode.dis, DIS.dis, ManakaiNode.dis,
	ManakaiNodeTest.dis: |For| specifications are removed.

	* common.dis: New module.

	* DIS.dis, PerlCode.dis, ManakaiNode.dis: |Util:| resource
	definitions are removed (and moved to |common.dis|).

	* DIS.dis (ForEmpty, ForLatest): Removed.

	* DIS.dis: |WithFor| and |DefaultFor| are removed.

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

++ manakai/lib/Message/Util/Error/ChangeLog	30 Dec 2006 11:59:28 -0000
2006-12-30  Wakaba  <wakaba@suika.fam.cx>

	* Core.dis, DOMException.dis: |WithFor|, |DefaultFor|,
	and |For| specificaitons are removed.

++ manakai/lib/Message/Util/Formatter/ChangeLog	30 Dec 2006 11:59:59 -0000
2006-12-30  Wakaba  <wakaba@suika.fam.cx>

	* Muf2003.dis: |WithFor|, |DefaultFor|, and |For|
	specifications are removed.

++ manakai/lib/Message/Util/DIS/ChangeLog	30 Dec 2006 11:58:54 -0000
	* Perl.dis, Value.dis, DNLite.dis,
	DPG.dis, Test.dis: |WithFor|, |For|, and |DefaultFor|
	specifications are removed.

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

++ manakai/lib/Message/DOM/ChangeLog	30 Dec 2006 11:53:43 -0000
        SimpleLS.dis, DOMMain.dis, XDP.dis: |For| specifications
	are removed.

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

	* CharacterData.dis, DOMCore.dis, DOMFeature.dis,
        GenericLS.dis, TreeCore.dis, DOMString.dis,
        XML.dis, Element.dis, Document.dis, TreeStore,dis,
        Traversal.dis, XDoctype.dis, XMLParser.dis, DOMLS.dis,
++ manakai/lib/Message/URI/ChangeLog	30 Dec 2006 11:54:30 -0000
	* Generic.dis: |For| specifications are removed.

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

++ manakai/lib/Message/Charset/ChangeLog	30 Dec 2006 11:54:10 -0000
	* Encode.dis: |For| specifications are removed.

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

++ manakai/lib/manakai/ChangeLog	30 Dec 2006 12:00:29 -0000
	* XML.dis: |DefaultFor| specification is removed.

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

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24