/[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.1 - (hide annotations) (download)
Sat May 13 12:06:21 2006 UTC (18 years, 6 months ago) by wakaba
Branch: MAIN
++ manakai/t/ChangeLog	13 May 2006 12:06:16 -0000
2006-05-13  Wakaba  <wakaba@suika.fam.cx>

	* Makefile (dom-XDP.t): New test.

++ manakai/lib/Message/Util/DIS/ChangeLog	13 May 2006 12:05:54 -0000
2006-05-13  Wakaba  <wakaba@suika.fam.cx>

	* Perl.dis: Use |createPCNumberLiteral| rather
	than |createPCLiteral| where appropriate.

++ manakai/lib/Message/DOM/ChangeLog	13 May 2006 12:05:21 -0000
	* XDP.dis: New module.

	* Makefile: |XDP.dis| is added.

	* Traversal.dis (NodeFilter): |InputProcessor|
	and |OutputProcessor| are added.

2006-05-13  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     $Date: 2006/05/13 05:40:58 $
17    
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     If <IF::Text> nodes are created, its
536     <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     If <IF::Text> nodes are created, its
623     <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     If <IF::Text> nodes are created, its
710     <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     If <IF::Text> nodes are created, its
796     <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     @@enDesc:
853     Creates a <XE::xdp|rni-keyword> element.
854     @@Param:
855     @@@Name: value
856     @@@Type: DOMString
857     @@@enDesc:
858     The value of the element.
859     @@@nullCase:
860     @@@@enDesc:
861     Same as an empty string.
862     @@Return:
863     @@@Type: XDPRNIKeywordElement
864     @@@enDesc:
865     The newly created element node.
866    
867     {P:: A new <IF::Element> node with following attributes
868     <kwd:MUST> be returned:
869    
870     - <A::Node.localName>::: <XE::rni-keyword>.
871    
872     - <A::Node.namespaceURI>::: <URI^^DISCore|QName::xdp|>.
873    
874     - <A::Node.ownerDocument>::: The document.
875    
876     - <A::Node.textContent>::: <P::value>, or an empty
877     string if <P::value> is <DOM::null>.
878    
879     }
880    
881     If <IF::Text> nodes are created, its
882     <A::Text.isElementContentWhitespace> attribute value
883     <kwd:MUST> be set to <DOM::false>.
884     @@@PerlDef:
885     __DEEP{
886     $r = $self-><M::Document.createElementNS> (<Q::xdp|>, 'rni-keyword');
887     $r-><AS::Node.textContent> (defined $value ? $value : '');
888     }__;
889    
890     @@Test:
891     @@@QName: XDPDocument.createXDPRNIKeyword.1.test
892     @@@PerlDef:
893     my $doc;
894     __CODE{createXDPDocumentForTest}__;
895    
896     my $value = "PCDATA";
897     my $el = $doc-><M::XDPDocument.createXDPRNIKeyword> ($value);
898    
899     $test->id ('interface');
900     $test->assert_isa ($el, <IFName::XDPElement>);
901    
902     $test->id ('namespaceURI');
903     $test->assert_equals ($el-><AG::Node.namespaceURI>, <Q::xdp|>);
904    
905     $test->id ('localName');
906     $test->assert_equals ($el-><AG::Node.localName>, 'rni-keyword');
907    
908     $test->id ('textContent');
909     $test->assert_equals ($el-><AG::Node.textContent>, $value);
910    
911     $test->id ('dtdText');
912     $test->assert_equals ($el-><AG::XDPElement.dtdText>, '#'.$value);
913     @@Test:
914     @@@QName: XDPDocument.createXDPRNIKeyword.2.test
915     @@@PerlDef:
916     my $doc;
917     __CODE{createXDPDocumentForTest}__;
918    
919     my $el = $doc-><M::XDPDocument.createXDPRNIKeyword> (null);
920    
921     $test->id ('interface');
922     $test->assert_isa ($el, <IFName::XDPElement>);
923    
924     $test->id ('namespaceURI');
925     $test->assert_equals ($el-><AG::Node.namespaceURI>, <Q::xdp|>);
926    
927     $test->id ('localName');
928     $test->assert_equals ($el-><AG::Node.localName>, 'rni-keyword');
929    
930     $test->id ('textContent');
931     $test->assert_equals ($el-><AG::Node.textContent>, '');
932    
933     $test->id ('dtdText');
934     $test->assert_equals ($el-><AG::XDPElement.dtdText>, '#');
935    
936     @Method:
937     @@Name: createXDPDelimiter
938     @@enDesc:
939     Creates a <XE::xdp|delimiter> element.
940     @@Param:
941     @@@Name: value
942     @@@Type: DOMString
943     @@@enDesc:
944     The value of the element.
945     @@@nullCase:
946     @@@@enDesc:
947     Same as an empty string.
948     @@Return:
949     @@@Type: XDPElement
950     @@@enDesc:
951     The newly created element node.
952    
953     {P:: A new <IF::Element> node with following attributes
954     <kwd:MUST> be returned:
955    
956     - <A::Node.localName>::: <XE::delimiter>.
957    
958     - <A::Node.namespaceURI>::: <URI^^DISCore|QName::xdp|>.
959    
960     - <A::Node.ownerDocument>::: The document.
961    
962     - <A::Node.textContent>::: <P::value>, or an empty
963     string if <P::value> is <DOM::null>.
964    
965     }
966    
967     If <IF::Text> nodes are created, its
968     <A::Text.isElementContentWhitespace> attribute value
969     <kwd:MUST> be set to <DOM::false>.
970     @@@PerlDef:
971     __DEEP{
972     $r = $self-><M::Document.createElementNS> (<Q::xdp|>, 'delimiter');
973     $r-><AS::Node.textContent> (defined $value ? $value : '');
974     }__;
975    
976     @@Test:
977     @@@QName: XDPDocument.createXDPDelimiter.1.test
978     @@@PerlDef:
979     my $doc;
980     __CODE{createXDPDocumentForTest}__;
981    
982     my $value = "%";
983     my $el = $doc-><M::XDPDocument.createXDPDelimiter> ($value);
984    
985     $test->id ('interface');
986     $test->assert_isa ($el, <IFName::XDPElement>);
987    
988     $test->id ('namespaceURI');
989     $test->assert_equals ($el-><AG::Node.namespaceURI>, <Q::xdp|>);
990    
991     $test->id ('localName');
992     $test->assert_equals ($el-><AG::Node.localName>, 'delimiter');
993    
994     $test->id ('textContent');
995     $test->assert_equals ($el-><AG::Node.textContent>, $value);
996    
997     $test->id ('dtdText');
998     $test->assert_equals ($el-><AG::XDPElement.dtdText>, $value);
999     @@Test:
1000     @@@QName: XDPDocument.createXDPDelimiter.2.test
1001     @@@PerlDef:
1002     my $doc;
1003     __CODE{createXDPDocumentForTest}__;
1004    
1005     my $el = $doc-><M::XDPDocument.createXDPDelimiter> (null);
1006    
1007     $test->id ('interface');
1008     $test->assert_isa ($el, <IFName::XDPElement>);
1009    
1010     $test->id ('namespaceURI');
1011     $test->assert_equals ($el-><AG::Node.namespaceURI>, <Q::xdp|>);
1012    
1013     $test->id ('localName');
1014     $test->assert_equals ($el-><AG::Node.localName>, 'delimiter');
1015    
1016     $test->id ('textContent');
1017     $test->assert_equals ($el-><AG::Node.textContent>, '');
1018    
1019     $test->id ('dtdText');
1020     $test->assert_equals ($el-><AG::XDPElement.dtdText>, '');
1021    
1022     @Method:
1023     @@Name: createXDPEntityValue
1024     @@enDesc:
1025     Creates a <XE::xdp|entity-value> element.
1026     @@Param:
1027     @@@Name: value
1028     @@@Type: DOMString
1029     @@@enDesc:
1030     The value of the element.
1031     @@@nullCase:
1032     @@@@enDesc:
1033     Same as an empty string.
1034     @@Return:
1035     @@@Type: XDPEntityValueElement
1036     @@@enDesc:
1037     The newly created element node.
1038    
1039     {P:: A new <IF::Element> node with following attributes
1040     <kwd:MUST> be returned:
1041    
1042     - <A::Node.localName>::: <XE::entity-value>.
1043    
1044     - <A::Node.namespaceURI>::: <URI^^DISCore|QName::xdp|>.
1045    
1046     - <A::Node.ownerDocument>::: The document.
1047    
1048     - <A::Node.textContent>::: <P::value>, or an empty
1049     string if <P::value> is <DOM::null>.
1050    
1051     }
1052    
1053     If <IF::Text> nodes are created, its
1054     <A::Text.isElementContentWhitespace> attribute value
1055     <kwd:MUST> be set to <DOM::false>.
1056     @@@PerlDef:
1057     __DEEP{
1058     $r = $self-><M::Document.createElementNS> (<Q::xdp|>, 'entity-value');
1059     $r-><AS::Node.textContent> (defined $value ? $value : '');
1060     }__;
1061    
1062     @@Test:
1063     @@@QName: XDPDocument.createXDPEntityValue.1.test
1064     @@@PerlDef:
1065     my $doc;
1066     __CODE{createXDPDocumentForTest}__;
1067    
1068     my $value = q<a%b;c&d;e"f"g'h'i>;
1069     my $qvalue = q<'a&#x25;b;c&#x26;d;e"f"g&#x27;h&#x27;i'>;
1070     my $el = $doc-><M::XDPDocument.createXDPEntityValue> ($value);
1071    
1072     $test->id ('interface');
1073     $test->assert_isa ($el, <IFName::XDPEntityValueElement>);
1074    
1075     $test->id ('namespaceURI');
1076     $test->assert_equals ($el-><AG::Node.namespaceURI>, <Q::xdp|>);
1077    
1078     $test->id ('localName');
1079     $test->assert_equals ($el-><AG::Node.localName>, 'entity-value');
1080    
1081     $test->id ('textContent');
1082     $test->assert_equals ($el-><AG::Node.textContent>, $value);
1083    
1084     $test->id ('dtdText');
1085     $test->assert_equals ($el-><AG::XDPElement.dtdText>, $qvalue);
1086     @@Test:
1087     @@@QName: XDPDocument.createXDPEntityValue.2.test
1088     @@@PerlDef:
1089     my $doc;
1090     __CODE{createXDPDocumentForTest}__;
1091    
1092     my $el = $doc-><M::XDPDocument.createXDPEntityValue> (null);
1093    
1094     $test->id ('interface');
1095     $test->assert_isa ($el, <IFName::XDPEntityValueElement>);
1096    
1097     $test->id ('namespaceURI');
1098     $test->assert_equals ($el-><AG::Node.namespaceURI>, <Q::xdp|>);
1099    
1100     $test->id ('localName');
1101     $test->assert_equals ($el-><AG::Node.localName>, 'entity-value');
1102    
1103     $test->id ('textContent');
1104     $test->assert_equals ($el-><AG::Node.textContent>, '');
1105    
1106     $test->id ('dtdText');
1107     $test->assert_equals ($el-><AG::XDPElement.dtdText>, '""');
1108    
1109     @Method:
1110     @@Name: createXDPMinimumLiteral
1111     @@enDesc:
1112     Creates a <XE::xdp|minimum-literal> element.
1113     @@Param:
1114     @@@Name: value
1115     @@@Type: DOMString
1116     @@@enDesc:
1117     The value of the element.
1118     @@@nullCase:
1119     @@@@enDesc:
1120     Same as an empty string.
1121     @@Return:
1122     @@@Type: XDPMinimumLiteralElement
1123     @@@enDesc:
1124     The newly created element node.
1125    
1126     {P:: A new <IF::Element> node with following attributes
1127     <kwd:MUST> be returned:
1128    
1129     - <A::Node.localName>::: <XE::minimum-literal>.
1130    
1131     - <A::Node.namespaceURI>::: <URI^^DISCore|QName::xdp|>.
1132    
1133     - <A::Node.ownerDocument>::: The document.
1134    
1135     - <A::Node.textContent>::: <P::value>, or an empty
1136     string if <P::value> is <DOM::null>.
1137    
1138     }
1139    
1140     If <IF::Text> nodes are created, its
1141     <A::Text.isElementContentWhitespace> attribute value
1142     <kwd:MUST> be set to <DOM::false>.
1143     @@@PerlDef:
1144     __DEEP{
1145     $r = $self-><M::Document.createElementNS>
1146     (<Q::xdp|>, 'minimum-literal');
1147     $r-><AS::Node.textContent> (defined $value ? $value : '');
1148     }__;
1149    
1150     @@Test:
1151     @@@QName: XDPDocument.createXDPMinimumLiteral.1.test
1152     @@@PerlDef:
1153     my $doc;
1154     __CODE{createXDPDocumentForTest}__;
1155    
1156     my $value = q<a%b;c&d;e"f"g'h'i>;
1157     my $qvalue = q<"a%b;c&d;e%22f%22g'h'i">;
1158     my $el = $doc-><M::XDPDocument.createXDPMinimumLiteral> ($value);
1159    
1160     $test->id ('interface');
1161     $test->assert_isa ($el, <IFName::XDPMinimumLiteralElement>);
1162    
1163     $test->id ('namespaceURI');
1164     $test->assert_equals ($el-><AG::Node.namespaceURI>, <Q::xdp|>);
1165    
1166     $test->id ('localName');
1167     $test->assert_equals ($el-><AG::Node.localName>, 'minimum-literal');
1168    
1169     $test->id ('textContent');
1170     $test->assert_equals ($el-><AG::Node.textContent>, $value);
1171    
1172     $test->id ('dtdText');
1173     $test->assert_equals ($el-><AG::XDPElement.dtdText>, $qvalue);
1174     @@Test:
1175     @@@QName: XDPDocument.createXDPMinimumLiteral.2.test
1176     @@@PerlDef:
1177     my $doc;
1178     __CODE{createXDPDocumentForTest}__;
1179    
1180     my $el = $doc-><M::XDPDocument.createXDPMinimumLiteral> (null);
1181    
1182     $test->id ('interface');
1183     $test->assert_isa ($el, <IFName::XDPMinimumLiteralElement>);
1184    
1185     $test->id ('namespaceURI');
1186     $test->assert_equals ($el-><AG::Node.namespaceURI>, <Q::xdp|>);
1187    
1188     $test->id ('localName');
1189     $test->assert_equals ($el-><AG::Node.localName>, 'minimum-literal');
1190    
1191     $test->id ('textContent');
1192     $test->assert_equals ($el-><AG::Node.textContent>, '');
1193    
1194     $test->id ('dtdText');
1195     $test->assert_equals ($el-><AG::XDPElement.dtdText>, '""');
1196    
1197     @Method:
1198     @@Name: createXDPSystemLiteral
1199     @@enDesc:
1200     Creates a <XE::xdp|system-literal> element.
1201     @@Param:
1202     @@@Name: value
1203     @@@Type: DOMString
1204     @@@enDesc:
1205     The value of the element.
1206     @@@nullCase:
1207     @@@@enDesc:
1208     Same as an empty string.
1209     @@Return:
1210     @@@Type: XDPSystemLiteralElement
1211     @@@enDesc:
1212     The newly created element node.
1213    
1214     {P:: A new <IF::Element> node with following attributes
1215     <kwd:MUST> be returned:
1216    
1217     - <A::Node.localName>::: <XE::system-literal>.
1218    
1219     - <A::Node.namespaceURI>::: <URI^^DISCore|QName::xdp|>.
1220    
1221     - <A::Node.ownerDocument>::: The document.
1222    
1223     - <A::Node.textContent>::: <P::value>, or an empty
1224     string if <P::value> is <DOM::null>.
1225    
1226     }
1227    
1228     If <IF::Text> nodes are created, its
1229     <A::Text.isElementContentWhitespace> attribute value
1230     <kwd:MUST> be set to <DOM::false>.
1231     @@@PerlDef:
1232     __DEEP{
1233     $r = $self-><M::Document.createElementNS>
1234     (<Q::xdp|>, 'system-literal');
1235     $r-><AS::Node.textContent> (defined $value ? $value : '');
1236     }__;
1237    
1238     @@Test:
1239     @@@QName: XDPDocument.createXDPSystemLiteral.1.test
1240     @@@PerlDef:
1241     my $doc;
1242     __CODE{createXDPDocumentForTest}__;
1243    
1244     my $value = q<a%b;c&d;e"f"g'h'i>;
1245     my $qvalue = q<"a%b;c&d;e%22f%22g'h'i">;
1246     my $el = $doc-><M::XDPDocument.createXDPSystemLiteral> ($value);
1247    
1248     $test->id ('interface');
1249     $test->assert_isa ($el, <IFName::XDPSystemLiteralElement>);
1250    
1251     $test->id ('namespaceURI');
1252     $test->assert_equals ($el-><AG::Node.namespaceURI>, <Q::xdp|>);
1253    
1254     $test->id ('localName');
1255     $test->assert_equals ($el-><AG::Node.localName>, 'system-literal');
1256    
1257     $test->id ('textContent');
1258     $test->assert_equals ($el-><AG::Node.textContent>, $value);
1259    
1260     $test->id ('dtdText');
1261     $test->assert_equals ($el-><AG::XDPElement.dtdText>, $qvalue);
1262     @@Test:
1263     @@@QName: XDPDocument.createXDPSystemLiteral.2.test
1264     @@@PerlDef:
1265     my $doc;
1266     __CODE{createXDPDocumentForTest}__;
1267    
1268     my $el = $doc-><M::XDPDocument.createXDPSystemLiteral> (null);
1269    
1270     $test->id ('interface');
1271     $test->assert_isa ($el, <IFName::XDPSystemLiteralElement>);
1272    
1273     $test->id ('namespaceURI');
1274     $test->assert_equals ($el-><AG::Node.namespaceURI>, <Q::xdp|>);
1275    
1276     $test->id ('localName');
1277     $test->assert_equals ($el-><AG::Node.localName>, 'system-literal');
1278    
1279     $test->id ('textContent');
1280     $test->assert_equals ($el-><AG::Node.textContent>, '');
1281    
1282     $test->id ('dtdText');
1283     $test->assert_equals ($el-><AG::XDPElement.dtdText>, '""');
1284    
1285     @Method:
1286     @@Name: createXDPAttrLiteral
1287     @@enDesc:
1288     Creates a <XE::xdp|attr-literal> element.
1289     @@Param:
1290     @@@Name: value
1291     @@@Type: DOMString
1292     @@@enDesc:
1293     The value of the element.
1294     @@@nullCase:
1295     @@@@enDesc:
1296     Same as an empty string.
1297     @@Return:
1298     @@@Type: XDPAttrLiteralElement
1299     @@@enDesc:
1300     The newly created element node.
1301    
1302     {P:: A new <IF::Element> node with following attributes
1303     <kwd:MUST> be returned:
1304    
1305     - <A::Node.localName>::: <XE::attr-literal>.
1306    
1307     - <A::Node.namespaceURI>::: <URI^^DISCore|QName::xdp|>.
1308    
1309     - <A::Node.ownerDocument>::: The document.
1310    
1311     - <A::Node.textContent>::: <P::value>, or an empty
1312     string if <P::value> is <DOM::null>.
1313    
1314     }
1315    
1316     If <IF::Text> nodes are created, its
1317     <A::Text.isElementContentWhitespace> attribute value
1318     <kwd:MUST> be set to <DOM::false>.
1319     @@@PerlDef:
1320     __DEEP{
1321     $r = $self-><M::Document.createElementNS>
1322     (<Q::xdp|>, 'attr-literal');
1323     $r-><AS::Node.textContent> (defined $value ? $value : '');
1324     }__;
1325    
1326     @@Test:
1327     @@@QName: XDPDocument.createXDPAttrLiteral.1.test
1328     @@@PerlDef:
1329     my $doc;
1330     __CODE{createXDPDocumentForTest}__;
1331    
1332     my $value = q<a%b;c&d;e"f"g'h'i>;
1333     my $qvalue = q<'a%b;c&amp;d;e"f"g&apos;h&apos;i'>;
1334     my $el = $doc-><M::XDPDocument.createXDPAttrLiteral> ($value);
1335    
1336     $test->id ('interface');
1337     $test->assert_isa ($el, <IFName::XDPAttrLiteralElement>);
1338    
1339     $test->id ('namespaceURI');
1340     $test->assert_equals ($el-><AG::Node.namespaceURI>, <Q::xdp|>);
1341    
1342     $test->id ('localName');
1343     $test->assert_equals ($el-><AG::Node.localName>, 'attr-literal');
1344    
1345     $test->id ('textContent');
1346     $test->assert_equals ($el-><AG::Node.textContent>, $value);
1347    
1348     $test->id ('dtdText');
1349     $test->assert_equals ($el-><AG::XDPElement.dtdText>, $qvalue);
1350     @@Test:
1351     @@@QName: XDPDocument.createXDPAttrLiteral.2.test
1352     @@@PerlDef:
1353     my $doc;
1354     __CODE{createXDPDocumentForTest}__;
1355    
1356     my $el = $doc-><M::XDPDocument.createXDPAttrLiteral> (null);
1357    
1358     $test->id ('interface');
1359     $test->assert_isa ($el, <IFName::XDPAttrLiteralElement>);
1360    
1361     $test->id ('namespaceURI');
1362     $test->assert_equals ($el-><AG::Node.namespaceURI>, <Q::xdp|>);
1363    
1364     $test->id ('localName');
1365     $test->assert_equals ($el-><AG::Node.localName>, 'attr-literal');
1366    
1367     $test->id ('textContent');
1368     $test->assert_equals ($el-><AG::Node.textContent>, '');
1369    
1370     $test->id ('dtdText');
1371     $test->assert_equals ($el-><AG::XDPElement.dtdText>, '""');
1372     ##XDPDocument
1373    
1374     IFClsDef:
1375     @IFQName: XDPElement
1376     @ClsQName: ManakaiDOMXDPElement
1377    
1378     @IFISA: Element
1379     @ClsISA: te|ManakaiDOMElement
1380    
1381     @s:elementType: AnyXDPElement||ManakaiDOM|all
1382    
1383     @Test:
1384     @@QName: createElementNS.XDPElement.test
1385     @@PerlDef:
1386     my $doc;
1387     __CODE{tc|createEmptyDocumentForTest:: $doc => $doc}__;
1388    
1389     my $el = $doc-><M::Document.createElementNS> (<Q::xdp:>, 'anElement');
1390    
1391     $test->assert_isa ($el, <IFName::XDPElement>);
1392    
1393     @Attr:
1394     @@Name: dtdText
1395     @@enDesc:
1396     The serialized representation of the element and its descendants.
1397     @@Type: DOMString
1398     @@Get:
1399     @@@enDesc:
1400     {ISSUE::
1401     Definition
1402     }
1403     @@@PerlDef:
1404     require Message::DOM::Traversal;
1405     my $doctrv = $self-><AG::Node.ownerDocument>
1406     -><M::Node.getFeature> (Traversal => '2.0');
1407     my $tw = $doctrv->create_tree_walker
1408     ($self, <C::NodeFilter.SHOW_ELEMENT> |
1409     <C::NodeFilter.SHOW_TEXT> |
1410     <C::NodeFilter.SHOW_CDATA_SECTION>,
1411     sub {
1412     my $node = $_[1];
1413     if ($node-><AG::Node.nodeType>
1414     == <C::Node.ELEMENT_NODE>) {
1415     my $ns = $node-><AG::Node.namespaceURI>;
1416     if (not defined $ns) {
1417     return <C::NodeFilter.FILTER_REJECT>;
1418     } elsif ($ns eq <Q::xdp|>) {
1419     return <C::NodeFilter.FILTER_ACCEPT>;
1420     } else {
1421     return <C::NodeFilter.FILTER_REJECT>;
1422     }
1423     } else {
1424     return <C::NodeFilter.FILTER_ACCEPT>;
1425     }
1426     }, true);
1427     my $current = $tw->first_child;
1428     $r = '';
1429     C: while (defined $current) {
1430     if ($current-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE>) {
1431     $r .= $current-><AG::XDPElement.dtdText>;
1432     } else {
1433     $r .= $current-><AG::Node.textContent>;
1434     }
1435    
1436     $current = $tw->next_sibling;
1437     } # C
1438     ##XDPElement
1439    
1440     ResourceDef:
1441     @QName: AnyXDPElement
1442     @DISCore:resourceType: s|AnyElementInNS
1443     @AppName:
1444     @@@: xdp|*
1445     @@ContentType: DISCore|QName
1446     @ForCheck: =ManakaiDOM|all
1447    
1448     IFClsETDef:
1449     @IFQName: XDPPEElement
1450     @ETQName: xdp|pe
1451     @ClsQName: ManakaiDOMXDPPEElement
1452    
1453     @IFISA: XDPElement
1454     @ClsISA: ManakaiDOMXDPElement
1455    
1456     @enDesc:
1457     An <XE::xdp|pe> element represents an XML parameter
1458     entity, an XML external subset entity, or an XML internal subset.
1459     ##XDPPEElement
1460    
1461     IFClsETDef:
1462     @IFQName: XDPElementElement
1463     @ETQName: xdp|element
1464     @ClsQName: ManakaiDOMXDPElementElement
1465    
1466     @IFISA: XDPElement
1467     @ClsISA: ManakaiDOMXDPElement
1468    
1469     @enDesc:
1470     An <XE::xdp|element> element represents an XML <XML::ELEMENT>
1471     declaration.
1472    
1473     @CAttr:
1474     @@Name: dtdText
1475     @@Type: DOMString
1476     @@Get:
1477     @@@PerlDef:
1478     $r = '<!ELEMENT'.$self->SUPER::dtd_text.'>';
1479     ##XDPElementElement
1480    
1481     IFClsETDef:
1482     @IFQName: XDPModelGroupElement
1483     @ETQName: xdp|model-group
1484     @ClsQName: ManakaiDOMXDPModelGroupElement
1485    
1486     @IFISA: XDPElement
1487     @ClsISA: ManakaiDOMXDPElement
1488    
1489     @enDesc:
1490     An <XE::xdp|model-group> element represents an XML model
1491     group.
1492    
1493     @CAttr:
1494     @@Name: dtdText
1495     @@Type: DOMString
1496     @@Get:
1497     @@@PerlDef:
1498     $r = '('.$self->SUPER::dtd_text.')';
1499     ##XDPModelGroupElement
1500    
1501     IFClsETDef:
1502     @IFQName: XDPAttlistElement
1503     @ETQName: xdp|attlist
1504     @ClsQName: ManakaiDOMXDPAttlistElement
1505    
1506     @IFISA: XDPElement
1507     @ClsISA: ManakaiDOMXDPElement
1508    
1509     @enDesc:
1510     An <XE::xdp|attlist> element represents an XML <XML::ATTLIST>
1511     declaration.
1512    
1513     @CAttr:
1514     @@Name: dtdText
1515     @@Type: DOMString
1516     @@Get:
1517     @@@PerlDef:
1518     $r = '<!ATTLIST'.$self->SUPER::dtd_text.'>';
1519     ##XDPAttlistElement
1520    
1521     IFClsETDef:
1522     @IFQName: XDPEnumGroupElement
1523     @ETQName: xdp|enum-group
1524     @ClsQName: ManakaiDOMXDPEnumGroupElement
1525    
1526     @IFISA: XDPElement
1527     @ClsISA: ManakaiDOMXDPElement
1528    
1529     @enDesc:
1530     An <XE::xdp|enum-group> element represents an XML enumeration
1531     group in an attribute definition.
1532    
1533     @CAttr:
1534     @@Name: dtdText
1535     @@Type: DOMString
1536     @@Get:
1537     @@@PerlDef:
1538     $r = '('.$self->SUPER::dtd_text.')';
1539     ##XDPEnumGroupElement
1540    
1541     IFClsETDef:
1542     @IFQName: XDPEntityElement
1543     @ETQName: xdp|entity
1544     @ClsQName: ManakaiDOMXDPEntityElement
1545    
1546     @IFISA: XDPElement
1547     @ClsISA: ManakaiDOMXDPElement
1548    
1549     @enDesc:
1550     An <XE::xdp|entity> element represents an XML <XML::ENTITY>
1551     declaration.
1552    
1553     @CAttr:
1554     @@Name: dtdText
1555     @@Type: DOMString
1556     @@Get:
1557     @@@PerlDef:
1558     $r = '<!ENTITY'.$self->SUPER::dtd_text.'>';
1559     ##XDPEntityElement
1560    
1561     IFClsETDef:
1562     @IFQName: XDPNotationElement
1563     @ETQName: xdp|notation
1564     @ClsQName: ManakaiDOMXDPNotationElement
1565    
1566     @IFISA: XDPElement
1567     @ClsISA: ManakaiDOMXDPElement
1568    
1569     @enDesc:
1570     An <XE::xdp|notation> element represents an XML <XML::NOTATION>
1571     declaration.
1572    
1573     @CAttr:
1574     @@Name: dtdText
1575     @@Type: DOMString
1576     @@Get:
1577     @@@PerlDef:
1578     $r = '<!NOTATION'.$self->SUPER::dtd_text.'>';
1579     ##XDPNotationElement
1580    
1581     IFClsETDef:
1582     @IFQName: XDPMarkedSectionElement
1583     @ETQName: xdp|marked-section
1584     @ClsQName: ManakaiDOMXDPMarkedSectionElement
1585    
1586     @IFISA: XDPElement
1587     @ClsISA: ManakaiDOMXDPElement
1588    
1589     @enDesc:
1590     An <XE::xdp|marked-section> element represents an XML conditional
1591     section.
1592    
1593     @CAttr:
1594     @@Name: dtdText
1595     @@Type: DOMString
1596     @@Get:
1597     @@@PerlDef:
1598     $r = '<!['.$self->SUPER::dtd_text.']]>';
1599     ##XDPMarkedSectionElement
1600    
1601     IFClsETDef:
1602     @IFQName: XDPMarkedSectionStatusElement
1603     @ETQName: xdp|marked-section-status
1604     @ClsQName: ManakaiDOMXDPMarkedSectionStatusElement
1605    
1606     @IFISA: XDPElement
1607     @ClsISA: ManakaiDOMXDPElement
1608    
1609     @enDesc:
1610     An <XE::xdp|marked-section-status> element represents the
1611     status part of an XML marked section.
1612    
1613     @CAttr:
1614     @@Name: dtdText
1615     @@Type: DOMString
1616     @@Get:
1617     @@@PerlDef:
1618     $r = $self->SUPER::dtd_text.'[';
1619     ##XDPMarkedSectionStatusElement
1620    
1621     IFClsETDef:
1622     @IFQName: XDPCommentElement
1623     @ETQName: xdp|comment
1624     @ClsQName: ManakaiDOMXDPCommentElement
1625    
1626     @IFISA: XDPElement
1627     @ClsISA: ManakaiDOMXDPElement
1628    
1629     @enDesc:
1630     An <XE::xdp|comment> element represents an XML comment.
1631    
1632     @CAttr:
1633     @@Name: dtdText
1634     @@Type: DOMString
1635     @@Get:
1636     @@@PerlDef:
1637     $r = $self->SUPER::dtd_text;
1638     $r =~ s/--/- - /g;
1639     $r = '<!--'.$r.'-->';
1640     ##XDPCommentElement
1641    
1642     IFClsETDef:
1643     @IFQName: XDPPIElement
1644     @ETQName: xdp|pi
1645     @ClsQName: ManakaiDOMXDPPIElement
1646    
1647     @IFISA: XDPElement
1648     @ClsISA: ManakaiDOMXDPElement
1649    
1650     @enDesc:
1651     An <XE::xdp|pi> element represents an XML processing
1652     instruction.
1653    
1654     @CAttr:
1655     @@Name: dtdText
1656     @@Type: DOMString
1657     @@Get:
1658     @@@PerlDef:
1659     $r = $self->SUPER::dtd_text;
1660     $r =~ s/\?>/?&gt;/g;
1661     $r = '<?'.$r.'?>';
1662     ##XDPPIElement
1663    
1664     IFClsETDef:
1665     @IFQName: XDPTextDeclElement
1666     @ETQName: xdp|text-decl
1667     @ClsQName: ManakaiDOMXDPTextDeclElement
1668    
1669     @IFISA: XDPElement
1670     @ClsISA: ManakaiDOMXDPElement
1671    
1672     @enDesc:
1673     An <XE::xdp|text-decl> element represents an XML text declaration.
1674    
1675     @CAttr:
1676     @@Name: dtdText
1677     @@Type: DOMString
1678     @@Get:
1679     @@@PerlDef:
1680     $r = $self->SUPER::dtd_text;
1681     $r =~ s/\?>/?&gt;/g;
1682     $r = '<?'.$r.'?>';
1683     ##XDPTextDeclElement
1684    
1685     IFClsETDef:
1686     @IFQName: XDPPAttrElement
1687     @ETQName: xdp|pattr
1688     @ClsQName: ManakaiDOMXDPPAttrElement
1689    
1690     @IFISA: XDPElement
1691     @ClsISA: ManakaiDOMXDPElement
1692    
1693     @enDesc:
1694     An <XE::xdp|pattr> element represents a pseudo-attribute.
1695     ##XDPPAttrElement
1696    
1697     IFClsETDef:
1698     @IFQName: XDPPERefElement
1699     @ETQName: xdp|peref
1700     @ClsQName: ManakaiDOMXDPPERefElement
1701    
1702     @IFISA: XDPElement
1703     @ClsISA: ManakaiDOMXDPElement
1704    
1705     @enDesc:
1706     An <XE::xdp|peref> element represents an XML parameter entity
1707     reference.
1708    
1709     @CAttr:
1710     @@Name: dtdText
1711     @@Type: DOMString
1712     @@Get:
1713     @@@PerlDef:
1714     $r = '%'.$self->SUPER::dtd_text.';';
1715     ##XDPPERefElement
1716    
1717     IFClsETDef:
1718     @IFQName: XDPGERefElement
1719     @ETQName: xdp|geref
1720     @ClsQName: ManakaiDOMXDPGERefElement
1721    
1722     @IFISA: XDPElement
1723     @ClsISA: ManakaiDOMXDPElement
1724    
1725     @enDesc:
1726     An <XE::xdp|geref> element represents an XML general entity
1727     reference.
1728    
1729     @CAttr:
1730     @@Name: dtdText
1731     @@Type: DOMString
1732     @@Get:
1733     @@@PerlDef:
1734     $r = '&'.$self->SUPER::dtd_text.';';
1735     ##XDPGERefElement
1736    
1737     IFClsETDef:
1738     @IFQName: XDPNCRElement
1739     @ETQName: xdp|ncr
1740     @ClsQName: ManakaiDOMXDPNCRElement
1741    
1742     @IFISA: XDPElement
1743     @ClsISA: ManakaiDOMXDPElement
1744    
1745     @enDesc:
1746     An <XE::xdp|ncr> element represents an XML numeric character
1747     reference.
1748    
1749     @CAttr:
1750     @@Name: dtdText
1751     @@Type: DOMString
1752     @@Get:
1753     @@@PerlDef:
1754     $r = '&#'.$self->SUPER::dtd_text.';';
1755     ##XDPNCRElement
1756    
1757     IFClsETDef:
1758     @IFQName: XDPHCRElement
1759     @ETQName: xdp|hcr
1760     @ClsQName: ManakaiDOMXDPHCRElement
1761    
1762     @IFISA: XDPElement
1763     @ClsISA: ManakaiDOMXDPElement
1764    
1765     @enDesc:
1766     An <XE::xdp|hcr> element represents an XML hexadecimal character
1767     reference.
1768    
1769     @CAttr:
1770     @@Name: dtdText
1771     @@Type: DOMString
1772     @@Get:
1773     @@@PerlDef:
1774     $r = '&#x'.$self->SUPER::dtd_text.';';
1775     ##XDPHCRElement
1776    
1777     IFClsETDef:
1778     @IFQName: XDPRNIKeywordElement
1779     @ETQName: xdp|rni-keyword
1780     @ClsQName: ManakaiDOMXDPRNIKeywordElement
1781    
1782     @IFISA: XDPElement
1783     @ClsISA: ManakaiDOMXDPElement
1784    
1785     @enDesc:
1786     An <XE::xdp|rni-keyword> element represents an XML keyword
1787     prepended by a <CHAR::NUMBER SIGN>.
1788    
1789     @CAttr:
1790     @@Name: dtdText
1791     @@Type: DOMString
1792     @@Get:
1793     @@@PerlDef:
1794     $r = '#'.$self->SUPER::dtd_text;
1795     ##XDPRNIKeywordElement
1796    
1797     IFClsETDef:
1798     @IFQName: XDPEntityValueElement
1799     @ETQName: xdp|entity-value
1800     @ClsQName: ManakaiDOMXDPEntityValueElement
1801    
1802     @IFISA: XDPElement
1803     @ClsISA: ManakaiDOMXDPElement
1804    
1805     @enDesc:
1806     An <XE::xdp|entity-value> element represents an XML entity
1807     value.
1808    
1809     @CAttr:
1810     @@Name: dtdText
1811     @@Type: DOMString
1812     @@Get:
1813     @@@PerlDef:
1814     require Message::DOM::Traversal;
1815     my $doctrv = $self-><AG::Node.ownerDocument>
1816     -><M::Node.getFeature> (Traversal => '2.0');
1817     my $tw = $doctrv->create_tree_walker
1818     ($self, <C::NodeFilter.SHOW_ELEMENT> |
1819     <C::NodeFilter.SHOW_TEXT> |
1820     <C::NodeFilter.SHOW_CDATA_SECTION>,
1821     sub {
1822     my $node = $_[1];
1823     if ($node-><AG::Node.nodeType>
1824     == <C::Node.ELEMENT_NODE>) {
1825     my $ns = $node-><AG::Node.namespaceURI>;
1826     if (not defined $ns) {
1827     return <C::NodeFilter.FILTER_REJECT>;
1828     } elsif ($ns eq <Q::xdp|>) {
1829     return <C::NodeFilter.FILTER_ACCEPT>;
1830     } else {
1831     return <C::NodeFilter.FILTER_REJECT>;
1832     }
1833     } else {
1834     return <C::NodeFilter.FILTER_ACCEPT>;
1835     }
1836     }, true);
1837     my $current = $tw->first_child;
1838     $r = '';
1839     C: while (defined $current) {
1840     if ($current-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE>) {
1841     if ({
1842     <Q::xdp|peref> => true,
1843     }->{$current->manakai_expanded_uri}) {
1844     $r .= $current-><AG::XDPElement.dtdText>;
1845     } else {
1846     my $v = $current-><AG::XDPElement.dtdText>;
1847     $v =~ s/&/&#x26;/g;
1848     $v =~ s/%/&#x25;/g;
1849     $r .= $v;
1850     }
1851     } else {
1852     my $v = $current-><AG::Node.textContent>;
1853     $v =~ s/&/&#x26;/g;
1854     $v =~ s/%/&#x25;/g;
1855     $r .= $v;
1856     }
1857    
1858     $current = $tw->next_sibling;
1859     } # C
1860    
1861     if ($r =~ /"/) {
1862     $r =~ s/'/&#x27;/g;
1863     $r = "'".$r."'";
1864     } else {
1865     $r =~ s/"/&#x22;/g;
1866     $r = '"'.$r.'"';
1867     }
1868     ##XDPEntityValueElement
1869    
1870     IFClsETDef:
1871     @IFQName: XDPAttrLiteralElement
1872     @ETQName: xdp|attr-literal
1873     @ClsQName: ManakaiDOMXDPAttrLiteralElement
1874    
1875     @IFISA: XDPElement
1876     @ClsISA: ManakaiDOMXDPElement
1877    
1878     @enDesc:
1879     An <XE::xdp|attr-literal> element represents an XML attribute
1880     value literal.
1881    
1882     @CAttr:
1883     @@Name: dtdText
1884     @@Type: DOMString
1885     @@Get:
1886     @@@PerlDef:
1887     require Message::DOM::Traversal;
1888     my $doctrv = $self-><AG::Node.ownerDocument>
1889     -><M::Node.getFeature> (Traversal => '2.0');
1890     my $tw = $doctrv->create_tree_walker
1891     ($self, <C::NodeFilter.SHOW_ELEMENT> |
1892     <C::NodeFilter.SHOW_TEXT> |
1893     <C::NodeFilter.SHOW_CDATA_SECTION>,
1894     sub {
1895     my $node = $_[1];
1896     if ($node-><AG::Node.nodeType>
1897     == <C::Node.ELEMENT_NODE>) {
1898     my $ns = $node-><AG::Node.namespaceURI>;
1899     if (not defined $ns) {
1900     return <C::NodeFilter.FILTER_REJECT>;
1901     } elsif ($ns eq <Q::xdp|>) {
1902     return <C::NodeFilter.FILTER_ACCEPT>;
1903     } else {
1904     return <C::NodeFilter.FILTER_REJECT>;
1905     }
1906     } else {
1907     return <C::NodeFilter.FILTER_ACCEPT>;
1908     }
1909     }, true);
1910     my $current = $tw->first_child;
1911     $r = '';
1912     C: while (defined $current) {
1913     if ($current-><AG::Node.nodeType> == <C::Node.ELEMENT_NODE>) {
1914     if ({
1915     <Q::xdp|geref> => true,
1916     <Q::xdp|ncr> => true,
1917     <Q::xdp|hcr> => true,
1918     }->{$current->manakai_expanded_uri}) {
1919     $r .= $current-><AG::XDPElement.dtdText>;
1920     } else {
1921     my $v = $current-><AG::XDPElement.dtdText>;
1922     $v =~ s/&/&amp;/g;
1923     $r .= $v;
1924     }
1925     } else {
1926     my $v = $current-><AG::Node.textContent>;
1927     $v =~ s/&/&amp;/g;
1928     $r .= $v;
1929     }
1930    
1931     $current = $tw->next_sibling;
1932     } # C
1933    
1934     if ($r =~ /"/) {
1935     $r =~ s/'/&apos;/g;
1936     $r = "'".$r."'";
1937     } else {
1938     $r =~ s/"/&quot;/g;
1939     $r = '"'.$r.'"';
1940     }
1941     ##XDPPAttrLiteralElement
1942    
1943     IFClsETDef:
1944     @IFQName: XDPMinimumLiteralElement
1945     @ETQName: xdp|minimum-literal
1946     @ClsQName: ManakaiDOMXDPMinimumLiteralElement
1947    
1948     @IFISA: XDPElement
1949     @ClsISA: ManakaiDOMXDPElement
1950    
1951     @enDesc:
1952     An <XE::xdp|minimum-literal> element represents an XML public identifier
1953     literal.
1954    
1955     @CAttr:
1956     @@Name: dtdText
1957     @@Type: DOMString
1958     @@Get:
1959     @@@PerlDef:
1960     $r = $self->SUPER::dtd_text;
1961     $r =~ s/"/%22/g;
1962     $r = '"'.$r.'"';
1963     ##XDPMinimumLiteralElement
1964    
1965     IFClsETDef:
1966     @IFQName: XDPSystemLiteralElement
1967     @ETQName: xdp|system-literal
1968     @ClsQName: ManakaiDOMXDPSystemLiteralElement
1969    
1970     @IFISA: XDPElement
1971     @ClsISA: ManakaiDOMXDPElement
1972    
1973     @enDesc:
1974     An <XE::xdp|system-literal> element represents an XML system
1975     literal.
1976    
1977     @CAttr:
1978     @@Name: dtdText
1979     @@Type: DOMString
1980     @@Get:
1981     @@@PerlDef:
1982     $r = $self->SUPER::dtd_text;
1983     $r =~ s/"/%22/g;
1984     $r = '"'.$r.'"';
1985     ##XDPSystemLiteralElement

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24