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