/[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.5 - (hide annotations) (download)
Sat May 20 10:13:02 2006 UTC (18 years, 6 months ago) by wakaba
Branch: MAIN
Changes since 1.4: +2 -1 lines
++ manakai/lib/Message/Markup/ChangeLog	20 May 2006 10:11:52 -0000
	* Atom.dis (AtomDataTypes): New module.

2006-05-20  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/Message/DOM/ChangeLog	20 May 2006 10:11:29 -0000
	* XDP.dis (createXDPRNIKeyword): The Perl method
	name property is added.

2006-05-20  Wakaba  <wakaba@suika.fam.cx>

++ manakai/lib/manakai/ChangeLog	20 May 2006 10:12:52 -0000
	* DISMarkup.dis: Definitions are added.

	* daf-dtd-modules.pl: Supports for element content
	models and attribute type groups are added.

2006-05-20  Wakaba  <wakaba@suika.fam.cx>

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24