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