File: Document.cs

package info (click to toggle)
mono 4.6.2.7+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 778,148 kB
  • ctags: 914,052
  • sloc: cs: 5,779,509; xml: 2,773,713; ansic: 432,645; sh: 14,749; makefile: 12,361; perl: 2,488; python: 1,434; cpp: 849; asm: 531; sql: 95; sed: 16; php: 1
file content (1331 lines) | stat: -rw-r--r-- 54,654 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
//**************************************************************************
//
//
//                       National Institute Of Standards and Technology
//                                     DTS Version 1.0
//         
//                                   Document Interface
//
// Written by: Carmelo Montanez
// Modified by:  Mary Brady
//
// Ported to System.Xml by: Mizrahi Rafael rafim@mainsoft.com
// Mainsoft Corporation (c) 2003-2004
//**************************************************************************
using System;
using System.Xml;

using nist_dom;
using NUnit.Framework;

namespace nist_dom.fundamental
{
    [TestFixture]
    public class DocumentTest
    {
        public static int i = 2;
/*
        public testResults[] RunTests()
        {
            testResults[] tests = new testResults[] {core0001D(), core0002D(), core0003D(), core0004D(),
                                                        core0005D(), core0006D(), core0007D(), core0008D(),
                                                        core0009D(), core0010D(), core0011D(), core0012D(),
                                                        core0013D(), core0014D(), core0015D(), 
                                                        core0019D(), core0020D(),
                                                        core0021D(), core0022D(), core0023D(), core0024D(),
                                                        core0025D()};
  
            return tests;
        }
*/


        //------------------------ test case core-0001T ------------------------
        //
        // Testing feature - The doctype attribute contains the Document Type 
        //                   Declaration associated with this Document. 
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    doctype attribute.  It should return the Document
        //                    type of this document.  Its document Type name 
        //                    should be equal to "staff".
        //                    
        // Semantic Requirements: 1
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0001D()
        {
            string computedValue = "";
            string expectedValue = "staff";
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0001D");

            results.description = "The doctype attribute contains the Document Type "+
                "Declaration associated with this object.";  
            //
            // Retrieve the targeted data and access its "doctype" attribute.
            //
            testNode = util.getDOMDocument(); 
            System.Xml.XmlDocumentType dtype = testNode.DocumentType;
            computedValue = dtype.Name;

            //
            // Write out results. 
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0001D --------------------------
        //
        //-------------------------- test case core-0002D ----------------------------
        //
        // Testing feature - The doctype attribute returns null for HTML documents.
        //
        // Testing approach - Retrieve the an HTML DOM document and invoke its
        //                    doctype attribute.  It should return null. 
        //
        // Semantic Requirements: 2 
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0002D()
        {
            string testName = "core-0002D";
            object computedValue = null;
            object expectedValue = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0002D");

            results.description = "The doctype attribute returns null for HTML "+
                "documents";
            //
            // Retrieve the targeted data and access its "doctype" attribute.
            //
            testNode = util.getDOMHTMLDocument();
            computedValue = (testNode.DocumentType == null).ToString();
            //
            // Write out results.
            //
            results.expected = (expectedValue == null).ToString();
            results.actual = computedValue.ToString();

            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0002D --------------------------
        //
        //-------------------------- test case core-0003D ----------------------------
        //
        // Testing feature - The doctype attribute returns null for XML documents
        //                   without a document type declaration.
        //
        // Testing approach - Retrieve an XML DOM document without a Document 
        //                    Type Declaration and invoke its doctype attribute.  
        //                    It should return null.
        //
        // Semantic Requirements: 2
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0003D()
        {
            object computedValue = null;
            object expectedValue = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0003D");

            results.description = "The doctype attribute returns null for XML "+
                " documents without a Document Type Declaration.";
            //
            // Retrieve the targeted data and access its "doctype" attribute.
            //
            testNode = util.getnoDTDXMLDocument();
            computedValue = (testNode.DocumentType == null).ToString();
            //
            // Write out results.
            //
            results.expected = (expectedValue == null).ToString();
            results.actual = computedValue.ToString();

            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0003D --------------------------
        //
        //-------------------------- test case core-0004D ----------------------------
        //
        // Testing feature - The implementation attribute contains the 
        //                   DOMImplementation object that handles this document.
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "implementation" attribute.  It should return a
        //                    DOMImplementation object whose "hasFeature("XML,"1.0")
        //                    method is invoke and a true value expected.  
        //
        // Semantic Requirements: 3 
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0004D()
        {
            string computedValue = "";
            string expectedValue = "True";
            System.Xml.XmlImplementation domImp = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0004D"); 

            results.description = "The implementation attribute contains the "+
                "DOMImplementation object that handles this"+
                " document.";
            //
            // Retrieve the targeted data and access its "implementation" attribute.
            //
            testNode = util.getDOMDocument();
            domImp = testNode.Implementation;
            //
            // The "hasFeature" method should return true.
            //
            computedValue = domImp.HasFeature("XML","1.0").ToString(); 
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0004D --------------------------
        //
        //-------------------------- test case core-0005D ----------------------------
        //
        // Testing feature - The documentElement attribute provides direct access
        //                   to the child node that is the root element of the
        //                   document.
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "documentElement" attribute.  It should return an 
        //                    Element node whose "tagName" attribute is "staff". 
        //
        // Semantic Requirements: 4 
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0005D()
        {
            string computedValue = "";
            string expectedValue = "staff";
            System.Xml.XmlElement rootNode = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0005D");

            results.description = "The documentElement attribute provides direct "+
                "to the root node of the document.";
            //
            // Retrieve the targeted data and access its "documentElement" attribute.
            //
            testNode = util.getDOMDocument();
            rootNode = testNode.DocumentElement;
            //
            // Its tagName should be set to "staff".
            //
            computedValue = rootNode.Name;//tagName;
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0005D --------------------------
        //
        //-------------------------- test case core-0006D ----------------------------
        //
        // Testing feature - For HTML documents, the documentElement attribute returns
        //                   the Element with the HTML tag.
        //
        // Testing approach - Retrieve an HTML DOM document and invoke its
        //                    "documentElement" attribute.  It should return the 
        //                    Element whose "tagName" is "HTML".
        //
        // Semantic Requirements: 5 
        //
        //----------------------------------------------------------------------------

        [Test]
	[Ignore(".NET DOM implementation does not match W3C DOM specification.")] // MS DOM is buggy
	public void core0006D()
        {
            string computedValue = "";
            string expectedValue = "HTML";
            System.Xml.XmlElement rootNode = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0006D");

            results.description = "For HTML documents, the documentElement attribute "+
                "returns the element with the HTML tag.";
            //
            // Retrieve the targeted data and access its "documentElement" attribute.
            //
            testNode = util.getDOMHTMLDocument();
            rootNode = testNode.DocumentElement;
            //
            // Its tagName should be set to "HTML".
            //
            computedValue = rootNode.Name;//tagName;
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0006D --------------------------
        //
        //-------------------------- test case core-0007D ----------------------------
        //
        // Testing feature - The "createElement(tagName)" method creates an Element of
        //                   the type specified. 
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "createElement(tagName)" method with tagName="address".
        //                    The method should create an instance of an Element 
        //                    node whose tagName is "address".  The type, value and
        //                    are further checked.
        //
        // Semantic Requirements: 6 
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0007D()
        {
            string computedValue = "";
            string expectedValue = "address Element ";
            System.Xml.XmlElement newElement = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0007D");

            results.description = "The \"createElement(tagName)\" method creates an "+
                "Element of the specified type.";
            //
            // Retrieve the targeted data and invoke its "createElement" attribute.
            //
            testNode = util.getDOMDocument();
            newElement = testNode.CreateElement("address");
            //
            // Retrieve the characteristics of this new object.
            //
            computedValue = newElement.Name+" ";//tagName
            computedValue += newElement.NodeType +" ";
            computedValue += newElement.Value;
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0007D --------------------------
        //
        //-------------------------- test case core-0008D ----------------------------
        //
        // Testing feature - The tagName parameter in the "createElement(tagName)"
        //                   method is case-sensitive for XML documents.
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "createElement(tagName)" method twice for tagName 
        //                    equal "address" and "ADDRESS".  Each call should
        //                    create two distinct Element nodes.  Each Element
        //                    is in turn assigned an attribute and then that 
        //                    attribute is retrieved. 
        //
        // Semantic Requirements: 7 
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0008D()
        {
            string computedValue = "";
            string expectedValue = "Fort Worth Dallas";
            System.Xml.XmlElement newElement1 = null;
            System.Xml.XmlElement newElement2 = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0008D");

            results.description = "The tagName parameter in the \"createElement( "+
                "tagName)\" method is case-sensitive for XML "+
                "documents.";
            //
            // Retrieve the targeted data and invoke its "createElement" method.
            //
            testNode = util.getDOMDocument();
            newElement1 = testNode.CreateElement("ADDRESS");
            newElement2 = testNode.CreateElement("address");
            //
            // Assign attributes for each one of the created Elements.
            //
            newElement1.SetAttribute("district","Fort Worth");
            newElement2.SetAttribute("county","Dallas");
            //
            // Now retrieve the values of each Element's attribute.
            //
            computedValue += newElement1.GetAttribute("district")+" ";
            computedValue += newElement2.GetAttribute("county");
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0008D --------------------------
        //
        //-------------------------- test case core-0009D ----------------------------
        //
        // Testing feature - The "createDocumentFragment()" method creates an 
        //                   empty DocumentFragment object.
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    createDocumentFragment() method.  The content, name,
        //                    type and value of the newly created object are
        //                    further retrieved and checked.
        //
        // Semantic Requirements: 8 
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0009D()
        {
            string computedValue = "";
            string expectedValue = "0 #document-fragment DocumentFragment ";//"0 #document-fragment 11 null";
            System.Xml.XmlDocumentFragment newDocFragment = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0009D");

            results.description = "The \"createDocumentFragment()\" method creates "+
                "an empty DocumentFragment object.";
            //
            // Retrieve the targeted data and invoke its "createDocumentFragment()" 
            // method.
            //
            testNode = util.getDOMDocument();
            newDocFragment = testNode.CreateDocumentFragment();
            //
            // Retrieve the characterstics of the newly created object.
            //
            computedValue += newDocFragment.ChildNodes.Count +" ";
            computedValue += newDocFragment.Name+" ";
            computedValue += newDocFragment.NodeType+" ";
            computedValue += newDocFragment.Value;
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0009D --------------------------
        //
        //-------------------------- test case core-0010D ----------------------------
        //
        // Testing feature - The "createTextNode(data)" method creates a Text node
        //                   given by the specified string. 
        //
        // Testing approach - Retrieve the entire DOM document and invoke its 
        //                    "createTextNode(data)" method.  It should create a
        //                    new Text node whose data is the specified string.  The
        //                    name and type of the newly created object are further
        //                    retrieved and checked.
        //
        // Semantic Requirements: 9 
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0010D()
        {
            string computedValue = "";
            string expectedValue = "This is a new Text node #text Text";//"This is a new Text node #text 3";
            System.Xml.XmlText newTextNode = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0010D");

            results.description = "The \"createTextNode(data)\" method creates "+
                "a Text node given by the specified string.";
            //
            // Retrieve the targeted data and invoke its "createTextNode(data)" method.
            //
            testNode = util.getDOMDocument();
            newTextNode = testNode.CreateTextNode("This is a new Text node");
            //
            // Retrieve the characteristics of the newly created object.
            //
            computedValue += newTextNode.Data+" ";
            computedValue += newTextNode.Name+" ";
            computedValue += newTextNode.NodeType;
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;
    
            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0010D --------------------------
        //
        //-------------------------- test case core-0011D ----------------------------
        //
        // Testing feature - The "createComment(data)" method creates a new Comment 
        //                   node given the specified string.
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "createComment(data)" method.  It should create a
        //                    new Comment node whose data is the specified string. 
        //                    The content, name and type of the newly created 
        //                    object are further retrieved and examined.
        //
        // Semantic Requirements: 10
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0011D()
        {
            string computedValue = "";
            string expectedValue = "This is a new Comment node #comment Comment";//"This is a new Comment node #comment 8";
            System.Xml.XmlComment newCommentNode = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0011D");

            results.description = "The \"createComment(data)\" method creates "+
                "a new comment node given by the specified string.";
            //
            // Retrieve the targeted data and invoke its "createComment(data)" method.
            //
            testNode = util.getDOMDocument();
            newCommentNode = testNode.CreateComment("This is a new Comment node");
            //
            // Retrieve the characteristics of the new object.
            //
            computedValue += newCommentNode.Data+" ";
            computedValue += newCommentNode.Name+" ";
            computedValue += newCommentNode.NodeType;
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0011D --------------------------
        //
        //-------------------------- test case core-0012D ----------------------------
        //
        // Testing feature - The "createCDATASection(data)" method creates a new 
        //                   CDATASection node whose value is the specified string.
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "createCDATASection(data)" method.  It should create a
        //                    new CDATASection node whose data is the specified string.
        //                    The content, name and type of the newly created
        //                    object are further retrieved and examined.
        //
        // Semantic Requirements: 11
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0012D()
        {
            string computedValue = "";
            string expectedValue = "This is a new CDATASection node #cdata-section CDATA";//"This is a new CDATASection node #cdata-section 4";
            System.Xml.XmlCDataSection newCDATASectionNode = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0012D");

            results.description = "The \"createCDATASection(data)\" method creates "+
                "a new CDATASection node whose value is the "+
                "specified string.";
            //
            // Retrieve the targeted data and invoke its "createCDATASection(data)"
            // method.
            //
            testNode = util.getDOMDocument();
            newCDATASectionNode = testNode.CreateCDataSection("This is a new CDATASection node");
            //
            // Retrieve the characteristics of the new object.
            //
            computedValue += newCDATASectionNode.Data+" ";
            computedValue += newCDATASectionNode.Name+" ";
            computedValue += newCDATASectionNode.NodeType;
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0012D --------------------------
        //
        //-------------------------- test case core-0013D ----------------------------
        //
        // Testing feature - The "createProcessingInstruction(target,data)" method
        //                   creates a new ProcessingInstruction node with the 
        //                   specified name and data strings.
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "createProcessingInstruction(target,data)" method.  It 
        //                    should create a new PI node with the specified target
        //                    and data.  The target, data and type of the newly created
        //                    object are further retrieved and examined.
        //
        // Semantic Requirements: 12
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0013D()
        {
            string computedValue = "";
            string expectedValue = "XML This is a new PI node ProcessingInstruction";//"XML This is a new PI node 7";
            System.Xml.XmlProcessingInstruction newPINode = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0013D");

            results.description = "The \"createProcessingInstruction(target,data)\" "+
                "method creates a new processingInstruction node.";
            //
            // Retrieve the targeted data and invoke its 
            // "createProcessingInstruction(target,data)" method.
            //
            testNode = util.getDOMDocument();
            newPINode = testNode.CreateProcessingInstruction("XML","This is a new PI node");
            //
            // Retrieve the characteristics of the new object.
            //
            computedValue += newPINode.Target+" ";
            computedValue += newPINode.Data+" ";
            computedValue += newPINode.NodeType;
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0013D --------------------------
        //
        //-------------------------- test case core-0014D ----------------------------
        //
        // Testing feature - The "createAttribute(name)" method creates an Attr 
        //                   node of the given name.
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "createAttribute(name)" method.  It should create a 
        //                    new Attr node with the given name.  The name, value 
        //                    and type of the newly created object are further 
        //                    retrieved and examined.
        //
        // Semantic Requirements: 13
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0014D()
        {
            string computedValue = "";
            string expectedValue = "district Attribute";//"district 2";
            System.Xml.XmlAttribute newAttrNode = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0014D"); 

            results.description = "The \"createAttribute(name)\" method creates "+
                "a new Attr node of the given name.";
            //
            // Retrieve the targeted data and invoke its "createAttribute(name)"
            // method.
            //
            testNode = util.getDOMDocument();
            newAttrNode = testNode.CreateAttribute("district");
            //
            // Retrieve the characteristics of the new object.
            //
            computedValue += newAttrNode.Name+" ";
            computedValue += newAttrNode.Value;
            computedValue += newAttrNode.NodeType;
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0014D --------------------------
        //
        //-------------------------- test case core-0015D ----------------------------
        //
        // Testing feature - The "createEntityReference(name)" method creates an 
        //                   EntityReference node. 
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "createEntityReference(name)" method.  It should
        //                    create a new EntityReference node for the Entity
        //                    with the given name.  The name, value and type of 
        //                    the newly created object are further retrieved 
        //                    and examined.
        //
        // Semantic Requirements: 14
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0015D()
        {
            string computedValue = "";
            string expectedValue = "ent1  EntityReference";//"ent1 null 5";
            System.Xml.XmlEntityReference newEntRefNode = null;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0015D");

            results.description = "The \"createEntityReference(name)\" method creates "+
                "a new EntityReference node.";
            //
            // Retrieve the targeted data and invoke its "createEntityReference(name)"
            // method.
            //
            testNode = util.getDOMDocument();
            newEntRefNode = testNode.CreateEntityReference("ent1");
            //
            // Retrieve the characteristics of the new object.
            //
            computedValue += newEntRefNode.Name+" ";
            computedValue += newEntRefNode.Value+" ";
            computedValue += newEntRefNode.NodeType;
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0015D --------------------------
        //
        //-------------------------- test case core-0016D ----------------------------
        //
        // Testing feature - The "getElementsByTagName(tagName)" method returns a
        //                   NodeList of all the Elements with a given tagName.
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "getElementsByTagName(tagName)" method with tagName
        //                    equal to "name".  The method should return a NodeList
        //                    that contains 5 elements.  
        //
        // Semantic Requirements: 15
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0016D()
        {
            string computedValue = "0";//0;
            string expectedValue = "5";//5;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0016D");

            results.description = "The \"getElementsByTagName(tagName)\" method "+
                "returns a NodeList of all the Elements with a "+
                "given tag name.";
            //
            // Retrieve the targeted data and invoke its "getElementsByTagName(tagName)"
            // method.
            //
            testNode = util.getDOMDocument();
            System.Xml.XmlNodeList elementList = testNode.GetElementsByTagName("name");
            //
            // Retrieve the length of the list.
            //
            computedValue = elementList.Count.ToString();
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0016D --------------------------
        //
        //-------------------------- test case core-0017D ----------------------------
        //
        // Testing feature - The "getElementsByTagName(tagName)" method returns a
        //                   NodeList of all the Elements with a given tagName in
        //                   a pre-order traversal of the tree.
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "getElementsByTagName(tagName)" method with tagName
        //                    equal to "name".  The method should return a NodeList
        //                    that contains 5 elements.  Further the fourth item in
        //                    the list is retrieved and checked.
        //
        // Semantic Requirements: 16
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0017D()
        {
            string computedValue = "0";//0;
            string expectedValue = "Jeny Oconnor";
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0017D");

            results.description = "The \"getElementsByTagName(tagName)\" method "+
                "returns a NodeList of all the Elements with a "+
                "given tag name in a preorder traversal of the tree.";
                //
                // Retrieve the targeted data and invoke its "getElementsByTagName(tagName)"
                // method.
                //
                testNode = util.getDOMDocument();
            System.Xml.XmlNodeList elementList = testNode.GetElementsByTagName("name");
            //
            // Retrieve the fourth item and its data.
            //
            computedValue = elementList.Item(util.FOURTH).FirstChild.Value;//Data;
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0017D --------------------------
        //
        //-------------------------- test case core-0018D ----------------------------
        //
        // Testing feature - The "getElementsByTagName(tagName)" method returns a
        //                   NodeList of all the Elements in the tree when the
        //                   tagName is equal to "*".
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "getElementsByTagName(tagName)" method with tagName
        //                    equal to "*".  The method should return a NodeList
        //                    that contains 41 elements, which is the total number
        //                    of Elements in the document.
        //
        // Semantic Requirements: 17
        //
        //----------------------------------------------------------------------------


        [Test]
	public void core0018D()
        {
            string computedValue = "0";//0;
	// Mmm, shouldn't the count be 36?
            string expectedValue = "36";//37;
            System.Xml.XmlDocument testNode = null;

            testResults results = new testResults("Core0018D");

            results.description = "The \"getElementsByTagName(tagName)\" method "+
                "returns a NodeList of all the Elements in the "+
                "tree when the tag name is equal to \"*\".";
            //
            // Retrieve the targeted data and invoke its "getElementsByTagName(tagName)"
            // method.
            //
            testNode = util.getDOMDocument();
            System.Xml.XmlNodeList elementList = testNode.GetElementsByTagName("*");
            //
            // Retrieve the length of the list.
            //
            computedValue = elementList.Count.ToString();
            //
            // Write out results.
            //
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0018D --------------------------
        //
        //------------------------- test case core-0019D -----------------------------
        //
        // Testing feature - The "createElement(tagName)" method raises an
        //                   INVALID_CHARACTER_ERR Exception if the
        //                   specified name contains an invalid character.
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "createElement(tagName)" method with the tagName
        //                    equals to the string "invalid^Name" which contains
        //                    an invalid character ("^") in it.  The desired
        //                    exception should be raised.
        //
        // Semantic Requirements: 18 
        //
        //----------------------------------------------------------------------------

        [Test]
	[Ignore(".NET DOM implementation does not match W3C DOM specification.")] // MS DOM is buggy
	public void core0019D()
        {
            string computedValue = "";
            System.Xml.XmlDocument testNode = null;
            System.Xml.XmlElement invalidElement = null;
            string expectedValue = util.INVALID_CHARACTER_ERR;

            testResults results = new testResults("Core0019D");

            results.description = "The \"createElement(tagName)\" method raises an "+
                "INVALID_CHARACTER_ERR Exception if the "+
                "specified name contains an invalid character."; 
            //
            // Retrieve the targeted data.
            //
            testNode = util.getDOMDocument();
            //
            // Attempt to create an Element with an invalid tagName should raise 
            // an exception.
            //
            try 
            {
                invalidElement =  testNode.CreateElement("invalid^Name");
            }
            catch(System.Exception ex)
            {
                computedValue = ex.GetType ().FullName;
            }

            //
            // Write out results.
            //
            results.expected = typeof (XmlException).FullName; // MS.NET BUG: It never raises an error.
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0019D -------------------------
        //
        //------------------------- test case core-0020D -----------------------------
        //
        // Testing feature - The "createAttribute(name)" method raises an
        //                   INVALID_CHARACTER_ERR Exception if the
        //                   specified name contains an invalid character.
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "createAttribute(name)" method with the name
        //                    equals to the string "invalid^Name" which contains
        //                    an invalid character ("^") in it.  The desired
        //                    exception should be raised.
        //
        // Semantic Requirements: 19 
        //
        //----------------------------------------------------------------------------

        [Test]
	[Ignore(".NET DOM implementation does not match W3C DOM specification.")] // MS DOM is buggy
	public void core0020D()
        {
            string computedValue = "";
            string expectedValue = util.INVALID_CHARACTER_ERR;
            System.Xml.XmlDocument testNode = null;
            System.Xml.XmlAttribute invalidAttr = null;

            testResults results = new testResults("Core0020D");

            results.description = "The \"createAttribute(name)\" method raises an "+
                "INVALID_CHARACTER_ERR Exception if the "+
                "specified name contains an invalid character.";
            //
            // Retrieve the targeted data.
            //
            testNode = util.getDOMDocument();
            //
            // Attempt to create an Attr node with an invalid name should raise
            // an exception.
            //
            try 
            {
                invalidAttr =  testNode.CreateAttribute("invalid^Name");
            }
            catch(System.Exception ex)
            {
                computedValue = ex.GetType ().FullName;
            }

            //
            // Write out results.
            //
            results.expected = typeof (ArgumentException).FullName; // MS.NET BUG: It never raises an error.
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0020D -------------------------
        //
        //------------------------- test case core-0021D -----------------------------
        //
        // Testing feature - The "createEntityReference(name)" method raises an
        //                   INVALID_CHARACTER_ERR Exception if the
        //                   specified name contains an invalid character.
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "createEntityReference(name)" method with the name
        //                    equals to the string "invalid^Name" which contains
        //                    an invalid character ("^") in it.  The desired
        //                    exception should be raised.
        //
        // Semantic Requirements: 20
        //
        //----------------------------------------------------------------------------

        [Test]
	[Ignore(".NET DOM implementation does not match W3C DOM specification.")] // MS DOM is buggy
	public void core0021D()
        {
            string computedValue = "";
            string expectedValue = "System.Xml.XmlException";//util.INVALID_CHARACTER_ERR;
            System.Xml.XmlDocument testNode = null;
            System.Xml.XmlEntityReference invalidEntRef = null;

            testResults results = new testResults("Core0021D");

            results.description = "The \"createEntityReference(name)\" method raises "+
                "an INVALID_CHARACTER_ERR Exception if the "+
                "specified name contains an invalid character.";
            //
            // Retrieve the targeted data.
            //
            testNode = util.getDOMDocument();
            //
            // Attempt to create an EntityReference node with an invalid name should 
            // raise an exception.
            //
            try 
            {
                invalidEntRef =  testNode.CreateEntityReference("invalid^Name");
            }
            catch(XmlException ex)
            {
                computedValue = ex.GetType ().FullName;
            }
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;
    
            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0021D -------------------------
        //
        //------------------------- test case core-0022D ----------------------------
        //
        // Testing feature - The "createProcessingInstruction(target,data)" method
        //                   raises an INVALID_CHARACTER_ERR Exception if an
        //                   invalid character was specified. (test for invalid
        //                   target) 
        //
        // Testing approach - Retrieve the entire DOM document and invoke its
        //                    "createProcessingInstruction(target,data)" method with 
        //                    the target equals to the string "invalid^target" which
        //                    contains an invalid character ("^") in it.  The desired
        //                    exception should be raised.
        //
        // Semantic Requirements: 21
        //
        //----------------------------------------------------------------------------

        [Test]
	[Ignore(".NET DOM implementation does not match W3C DOM specification.")] // MS DOM is buggy
	public void core0022D()
        {
            string computedValue = "";
            string expectedValue = "System.Xml.XmlException";//util.INVALID_CHARACTER_ERR;
            System.Xml.XmlDocument testNode = null;
            System.Xml.XmlProcessingInstruction invalidPI = null;

            testResults results = new testResults("Core0022D"); 

            results.description = "The \"createProcessingInstruction(target,data)\" "+
                "method raises an INVALID_CHARACTER_ERR "+
                "DOMException if an invalid character was specified "+                          "(invalid target).";
            //
            // Retrieve the targeted data.
            //
            testNode = util.getDOMDocument();
            //
            // Attempt to create a ProcessingInstruction node with an invalid
            // target name should raise an exception.
            //
            try 
            {
                invalidPI =  testNode.CreateProcessingInstruction("invalid^target","data");
            }
            catch(XmlException ex)
            {
                computedValue = ex.GetType ().FullName;
            }

            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0022D -------------------------
        //
        //------------------------- test case core-0023D ----------------------------
        //
        // Testing feature - The "createCDATASection(data)" method raises a
        //                   NOT_SUPPORTED_ERR Exception if this is an
        //                   HTML document.
        //
        // Testing approach - Retrieve an HTML based DOM document and invoke its
        //                    "createCDATASection(data)" method.  Since this DOM
        //                    document was based on an HTML document, the desired
        //                    exception should be raised.
        //
		// System.Xml       -  Microsoft System.Xml does not supporting this requirement
		//
        // Semantic Requirements: 22
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0023D()
        {
            string computedValue = "";
            string expectedValue = "";//util.NOT_SUPPORTED_ERR;
            System.Xml.XmlDocument testNode = null;
            System.Xml.XmlCDataSection invalidCData = null;

            testResults results = new testResults("Core0023D");

            results.description = "The \"createCDATASection(data)\" method raises "+
                "a NOT_SUPPORTED_ERR Exception if this is "+
                "an HTML document.";
            //
            // Retrieve the targeted data.
            //
            testNode = util.getDOMHTMLDocument();
            //
            // Attempt to create a CDATASection node for an HTML based DOM Document 
            // should raise an exception.
            //
            try 
            {
                invalidCData =  testNode.CreateCDataSection("This is a new CDATA Section");
            }
            catch(System.Exception ex)
            {
                computedValue = ex.GetType () + " : " + ex.Message;
            }
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0023D -------------------------
        //
        //------------------------- test case core-0024D ----------------------------
        //
        // Testing feature - The "createProcessingInstruction(target,data)" method
        //                   raises a NOT_SUPPORTED_ERR Exception if this is an
        //                   HTML document.
        //
        // Testing approach - Retrieve an HTML based DOM document and invoke its
        //                    "createProcessingInstruction(target,data)" method. 
        //                    Since this DOM document was based on an HTML document, 
        //                    the desired exception should be raised.
        //
		// System.Xml       -  Microsoft System.Xml does not supporting this requirement
        // Semantic Requirements: 23
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0024D()
        {
            string computedValue = "";
            string expectedValue = "";//util.NOT_SUPPORTED_ERR;
            System.Xml.XmlDocument testNode = null;
            System.Xml.XmlProcessingInstruction invalidPI = null;

            testResults results = new testResults("Core0024D");

            results.description = "The \"createProcessingInstruction(target,data)\" "+
                "method raises a NOT_SUPPORTED_ERR Exception "+
                "if this is an HTML document.";
            //
            // Retrieve the targeted data.
            //
            testNode = util.getDOMHTMLDocument();
            //
            // Attempt to create a ProcessingInstruction node for an HTML based DOM
            // Document should raise an exception.
            //
            try 
            {
                invalidPI =  testNode.CreateProcessingInstruction("XML","This is a new PI node"); 
            }
            catch(System.Exception ex)
            {
                computedValue = ex.GetType () + " : " + ex.Message;
            }
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0024D -------------------------
        //
        //------------------------- test case core-0025D ----------------------------
        //
        // Testing feature - The "createEntityReference(data)" method raises
        //                   a NOT_SUPPORTED_ERR Exception if this is an
        //                   HTML document.
        //
        // Testing approach - Retrieve an HTML based DOM document and invoke its
        //                    "createEntityReference(name)" method.  Since this DOM 
        //                    document was based on an HTML document, the desired 
        //                    exception should be raised.
        //
		// System.Xml       -  Microsoft System.Xml does not supporting this requirement
		//
        // Semantic Requirements: 24
        //
        //----------------------------------------------------------------------------

        [Test]
	public void core0025D()
        {
            string computedValue = "";
            string expectedValue = "";//util.NOT_SUPPORTED_ERR;
            System.Xml.XmlDocument testNode = null;
            System.Xml.XmlEntityReference invalidEntRef = null;

            testResults results = new testResults("Core0025D");

            results.description = "The \"createEntityReference(name)\" method raises "+
                "a NOT_SUPPORTED_ERR Exception if this is an "+
                "HTML document.";
            //
            // Retrieve the targeted data.
            //
            testNode = util.getDOMHTMLDocument();
            //
            // Attempt to create an EntityReference node for an HTML based DOM
            // Document should raise an exception.
            //
            try 
            {
                invalidEntRef =  testNode.CreateEntityReference("ent1");
            }
            catch(System.Exception ex)
            {
                computedValue = ex.GetType().ToString();

            }
            //
            // Write out results.
            //
            results.expected = expectedValue;
            results.actual = computedValue;

            util.resetData();
            Assert.AreEqual (results.expected, results.actual);
        }

        //------------------------ End test case core-0025D -------------------------
    }
}