/[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.15 - (show annotations) (download)
Sat Nov 4 12:25:14 2006 UTC (17 years, 5 months ago) by wakaba
Branch: MAIN
Changes since 1.14: +11 -17 lines
++ manakai/bin/ChangeLog	4 Nov 2006 11:58:05 -0000
2006-11-04  Wakaba  <wakaba@suika.fam.cx>

	* daf.pl: The |--debug| option no longer set
	obsoleted |$Message::DOM::DOMFeature::DEBUG| option.

++ manakai/lib/Message/Markup/ChangeLog	4 Nov 2006 12:14:20 -0000
2006-11-04  Wakaba  <wakaba@suika.fam.cx>

	* Atom.dis (AtomImplementation): It no
        longer inherits the |ManakaiDOMImplementation|; it
        is now expected to be implemented by |DOMImplementation|
        objects.
	(AtomDocument, AtomFeedDocument, AtomEntryDocument): It no
        longer inherits the |ManakaiDOMDocument|; it
        is now expected to be implemented by |Document|
        objects.

	* SuikaWikiConfig21.dis (SWCFGImplementation): It no
        longer inherits the |DOMImplementation|; it
        is now expected to be implemented by |DOMImplementation|
        objects.

++ manakai/lib/Message/Util/ChangeLog	4 Nov 2006 12:18:18 -0000
2006-11-04  Wakaba  <wakaba@suika.fam.cx>

	* DIS.dis (ManakaiDISImplementation): It no longer
	inherits |ManakaiDISImplementationValue|,
	|ManakaiDISImplementationPerl|, and |ManakaiSWCFGImplementation|
	interfaces.  The class is now expected to be implemented
	by |DOMImplementation| objects.

	* PerlCode.dis (addImplementedFeature, addImplementedElementType):
	New methods.
	(PCHasFeature, PCElementType): New interfaces.
	(PCDocument): It no longer inherits the |ManakaiDOMDocument|; it
        is now expected to be implemented by |Document|
        objects.
	(PCImplementation): It no longer inherits the |ManakaiDOMImplementation|;
	it is now expected to be implemented by |DOMImplementation|
	objects.

++ manakai/lib/Message/Util/DIS/ChangeLog	4 Nov 2006 12:24:32 -0000
2006-11-04  Wakaba  <wakaba@suika.fam.cx>

	* DNLite.dis (DISImplementationDNLite): It no
	longer inherits the |ManakaiDISImplementation|; it
        is now expected to be implemented by |DOMImplementation| objects.

	* DPG.dis (DPGDocument): It no longer inherits
	the |ManakaiDOMDocument| class; it is now expected to be
	implemented by all |Document| objects.

	* Perl.dis (DISImplementationPerl): It is now
	expected to be implemented by all |DOMImplementation| objects.
	(plCodeFragment): Support for the |p:require|
	property is added.  It no longer output |ClassInfo|
	for classes for specific element types; instead,
	it invoke |add_implemented_element_type| method.

	* Test.dis (DTImplementation): It no longer
	inherits the |MinimumImplementation| interface;
	instead, it is expected to be implemented
	by all |DOMImplementation| objects.

	* Value.dis (DISImplementationValue): It is now
	expected to be implemented by all |DOMImplementation| objects.

++ manakai/lib/Message/Util/AutoLoad/ChangeLog	4 Nov 2006 12:19:43 -0000
2006-11-04  Wakaba  <wakaba@suika.fam.cx>

	* Config.pm (register_all, save): Support for |feature|
	and |element_type| is added.

	* Registry-initial.pm: Updated.

	* .cvsignore: New file.


	* Registry-initial.pm: New module.
++ manakai/lib/Message/DOM/ChangeLog	4 Nov 2006 12:12:45 -0000
	explicitly inherits |urigen:ManakaiURIImplementation| (and
	the |f:ManakaiMinimumImplementation| class inherited
	by it).  The |f:Minimum| feature is ever implemented
	for compatibility (but is expected to be removed).
	Internal methods such as |___report_error| are copied from
	obsolete |f:MinimumImplementation| class.  DOM3
	methods |hasFeature| and |getFeature| are also
	moved from that class, but they now support no
	foreign classes.

	* DOMFeature.dis (ManakaiImplementationSource): It
	now |p:require|s |Message::Util::AutoLoad::Registry|.
	The class no longer support classes
	other than |ManakaiDOMImplementation|.  Note
	that the |ImplementationRegistry| object does continue
	to support foreign classes via foreign classes
	implementing |ImplementationSource|
	or |DOMImplementationSource| interface.
	(MinimumImplementation): Removed.

	* DOMLS.dis (ManakaiDOMImplementationLS): It no
	longer inherit the |ManakaiDOMImplementation|; it
	is now expected to be implemented by |DOMImplementation|
	objects.

	* DOMMain.dis (null): Removed.

	* Document.dis (___create_node_ref): It no
	longer support foreign classes other
	than |Message::DOM::Document::ManakaiDOMDocument|.
	Note that document format specific DOM
	interfaces, if supported, should be
	all instances of the |Document| interface
	in the implementation, as defined
	in the Web Applications 1.0 specification (where
	the |HTMLDocument| interface must be implemented
	by all |Document| objects, even if the |Document|
	contains no HTML element).

	* GenericLS.dis (GLSImplementation): It no
        longer inherit the |MinimumImplementation|; it
        is now expected to be implemented by |DOMImplementation|
        objects.
	(createGLSParser, createGLSSerializer): Load
	module implementing parser or serializer
	if necessary.

	* Traversal.dis (ManakaiDOMDocumentTraversal): It no
	longer inherits the |ManakaiDOMDocument|; it
	is now expected to be implemented by |Document|
	objects.

	* XDP.dis (XDPDocument): It no longer
	inherits the |Document|; it is now expected
	to be implemented by all |Document| objects.

	* XDoctype.dis (ManakaiDOMDocumentXDoctype): It no
        longer inherits the |ManakaiDOMDocument|; it
        is now expected to be implemented by |Document|
        objects.

2006-11-04  Wakaba  <wakaba@suika.fam.cx>

	* DOMCore.dis (ManakaiDOMImplementation): No longer
++ manakai/lib/Message/URI/ChangeLog	4 Nov 2006 12:14:59 -0000
2006-11-04  Wakaba  <wakaba@suika.fam.cx>

	* Generic.dis (URIImplementation): It no
	longer inherits the |MinimumImplementation|; it
	is now expected to be implemented by |DOMImplementation|
	objects.

++ manakai/lib/Message/Charset/ChangeLog	4 Nov 2006 11:56:24 -0000
2006-11-04  Wakaba  <wakaba@suika.fam.cx>

	* Encode.dis (MCEncodeImplementation): It no
	longer inherit the |MinimumImplementation|; it
	is now expected to be implemented by |DOMImplementation|
	objects.

++ manakai/lib/manakai/ChangeLog	4 Nov 2006 12:25:03 -0000
2006-11-04  Wakaba  <wakaba@suika.fam.cx>

	* DISPerl.dis (p:require, p:use): New properties.

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24