/[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.9 - (show annotations) (download)
Wed Aug 16 10:30:03 2006 UTC (17 years, 8 months ago) by wakaba
Branch: MAIN
Changes since 1.8: +89 -1 lines
++ manakai/lib/Message/Markup/ChangeLog	16 Aug 2006 10:27:30 -0000
2006-08-16  Wakaba  <wakaba@suika.fam.cx>

	* Atom.dis (AtomProperties): Components |atomUriCM|
	and |atomEmailAddressCM| are added.
	(atomUriCM, atomEmailAddressCM): News.
	(AtomTextConstruct, AtomPersonConstruct, AtomDateConstruct,
	atom|feed, atom|entry, atom|source, atom|id, atom|uri,
	atom|name, atom|id, atom|email, atom|logo, atom|content,
	atom|category, atom|generator, atom|link): Content
	models are specified.
	(undefinedContent): New.

++ manakai/lib/manakai/ChangeLog	16 Aug 2006 10:29:55 -0000
2006-08-16  Wakaba  <wakaba@suika.fam.cx>

	* DISMarkup.dis (mv|AnyElementContent, mv|EmptyElementContent): News.

	* XML.dis (dxm|AnyElementContent, dxm|ANY, dxm|EMPTY): News.
	(dxm|ElementContent, dxm|MixedContent): News.

	* daf-dtd-modules.pl (daf_dtd_modules): Support
	for content model resources's content models are added.
	(daf_dtd_cm): Expanded to handle cases in which
	no XMLized property value is specified.
	(daf_dm_get_entity_name): Do right thing even if suffix is not specified.

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24