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