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