/[suikacvs]/messaging/manakai/lib/Message/DOM/XDP.dis
Suika

Contents of /messaging/manakai/lib/Message/DOM/XDP.dis

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (show annotations) (download)
Sat Dec 30 13:25:34 2006 UTC (17 years, 10 months ago) by wakaba
Branch: MAIN
CVS Tags: manakai-release-0-4-0, HEAD
Changes since 1.12: +2 -5 lines
Error occurred while calculating annotation data.
++ manakai/lib/Message/Util/DIS/ChangeLog	30 Dec 2006 13:23:58 -0000
	* Perl.dis (plCodeFragment): Support for |f:provides|
	is removed.

2006-12-30  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/Message/DOM/ChangeLog	30 Dec 2006 13:22:55 -0000
	* DOMFeature.dis (ForDef): Removed.
	(f:provides, f:through): Removed.
	(Version): Removed.
	(implementFeature): Removed.

2006-12-30  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/manakai/ChangeLog	30 Dec 2006 13:25:24 -0000
	* DISIDL.dis, Java.dis, ECMAScript.dis,
	Document.dis, DISPerl.dis, XML.dis (ForDef): Removed.

	* DISMarkup.dis (ForET): Removed.

	* |DefaultFor| properties are removed.

	* DISCore.dis (DefaultFor): Removed.

2006-12-30  Wakaba  <wakaba@suika.fam.cx>

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24