Newer
Older
<?xml version="1.0" standalone="no"?>
<!--
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<!DOCTYPE s1 SYSTEM "sbk:/style/dtd/document.dtd">
<s1 title="Migration Archive">
<s2 title="Migrating to earlier Releases">
<ul>
<li><link anchor="Migrateto250">Migrating from &XercesCName; 2.4.0 to 2.5.0</link></li>
<li><link anchor="Migrateto240">Migrating from &XercesCName; 2.3.0 to 2.4.0</link></li>
<li><link anchor="Migrateto230">Migrating from &XercesCName; 2.2.0 to 2.3.0</link></li>
<li><link anchor="Migrateto220">Migrating from &XercesCName; 2.1.0 to 2.2.0</link></li>
<li><link anchor="Migrateto210">Migrating from &XercesCName; 2.0.0 to 2.1.0</link></li>
<li><link anchor="Migrateto200">Migrating from &XercesCName; 1.7.0 to 2.0.0</link></li>
<li><link anchor="Migrateto170">Migrating from &XercesCName; 1.6.0 to 1.7.0</link></li>
<li><link anchor="Migrateto160">Migrating from &XercesCName; 1.5.2 to 1.6.0</link></li>
<li><link anchor="Migrateto152">Migrating from &XercesCName; 1.4.0 to 1.5.2</link></li>
<li><link anchor="Migrateto140">Migrating from XML4C 2.x to 1.4.0</link></li>
</ul>
</s2>
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
<anchor name="Migrateto250"/>
<s2 title="Migrating from &XercesCName; 2.4.0 to &XercesCName; 2.5.0">
<p>The following section is a discussion of the technical differences between
&XercesCName; 2.4.0 code base and the &XercesCName; 2.5.0.</p>
<p>Topics discussed are:</p>
<ul>
<li><link anchor="NewFeatures250">New features in &XercesCName; 2.5.0</link></li>
<li><link anchor="API250">Public API Changes</link></li>
<ul>
<li><link anchor="NewAPI250">New Public API</link></li>
<li><link anchor="ModifiedAPI250">Modified Public API</link></li>
<li><link anchor="DeprecatedAPI250">Deprecated/Removed Public API</link></li>
</ul>
</ul>
<anchor name="NewFeatures250"/>
<s3 title="New features in &XercesCName; 2.5.0">
<ul>
<li>Fix duplicate attribute detection when namespaces are disabled </li>
<li>Stricter use of static memory manager for static data only</li>
<li>PSVI bug fix and enhencement </li>
<li>ThreadTest with grammar caching</li>
<li>Re-pluggable Panic Handler</li>
<li>Enhenced mutex creation to impove thread safety</li>
<li>Intrinsic transcoding support for 390.</li>
<li>Canonical Representation Support </li>
<li>New sample SCMPrint</li>
<li>New sample PSVIWriter</li>
<li>New test XSerializerTest</li>
</ul>
</s3>
<anchor name="API250"/>
<s3 title="Public API Changes">
<p>The following lists the public API changes between the &XercesCName;
2.4.0; and the &XercesCName; 2.5.0 releases
of the parser. </p>
<anchor name="NewAPI250"/>
<s4 title="New Public API">
<ul>
<li></li>
</ul>
</s4>
<anchor name="ModifiedAPI250"/>
<s4 title="Modified Public API">
<ul>
<li></li>
</ul>
</s4>
<anchor name="DeprecatedAPI250"/>
<s4 title="Deprecated/Removed Public API">
<ul>
<li></li>
</ul>
</s4>
</s3>
</s2>
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
<anchor name="Migrateto240"/>
<s2 title="Migrating from &XercesCName; 2.3.0 to &XercesCName; 2.4.0">
<p>The following section is a discussion of the technical differences between
&XercesCName; 2.3.0 code base and the &XercesCName; 2.4.0.</p>
<p>Topics discussed are:</p>
<ul>
<li><link anchor="NewFeatures240">New features in &XercesCName; 2.4.0</link></li>
<li><link anchor="API240">Public API Changes</link></li>
<ul>
<li><link anchor="NewAPI240">New Public API</link></li>
<li><link anchor="ModifiedAPI240">Modified Public API</link></li>
<li><link anchor="DeprecatedAPI240">Deprecated/Removed Public API</link></li>
</ul>
</ul>
<anchor name="NewFeatures240"/>
<s3 title="New features in &XercesCName; 2.4.0">
<ul>
<li>PSVI</li>
<li>Performance enhancement</li>
<li>Stateless Grammar </li>
<li>Grammar Serialization/Deserialiation</li>
</ul>
</s3>
<anchor name="API240"/>
<s3 title="Public API Changes">
<p>The following lists the public API changes between the &XercesCName;
2.3.0; and the &XercesCName; 2.4.0 releases
of the parser. </p>
<anchor name="NewAPI240"/>
<s4 title="New Public API">
<ul>
<li>PSVI related</li>
<li>Grammar serialization/deserialization related</li>
</ul>
</s4>
<anchor name="ModifiedAPI240"/>
<s4 title="Modified Public API">
<ul>
<li></li>
</ul>
</s4>
<anchor name="DeprecatedAPI240"/>
<s4 title="Deprecated/Removed Public API">
<ul>
<li>XMLAttDef: getProvided, getDOMTypeInfoUri, getDOMTypeInfoName, setProvided</li>
<li>XMLAttDefList: hasMoreElements, nextElement, Reset</li>
<li>DTDAttDefList: hasMoreElements, nextElement, Reset</li>
<li>SchemaAttDefList: hasMoreElements, nextElement, Reset</li>
<li>XMLElementDecl: LookupOpts</li>
<li>XMLNumber family: toString</li>
<li>ENTITYDatatypeValidator: setEntityDeclPool</li>
<li>IDDatatypeValidator: setIDRefList</li>
<li>IDREFDatatypeValidator: setIDRefList</li>
<li>GeneralAttributeCheck: setIDRefList</li>
<li>SchemaGrammar: getIDRefList</li>
<li>SchemaElementDecl: all non thread safe methods </li>
<li>SchemaAttDef: getters </li>
<li>DTDGrammar: getRootElemId</li>
</ul>
</s4>
</s3>
</s2>
<s2 title="Migrating from &XercesCName; 2.2.0 to &XercesCName; 2.3.0">
<p>The following section is a discussion of the technical differences between
&XercesCName; 2.2.0 code base and the &XercesCName; 2.3.0.</p>
<p>Topics discussed are:</p>
<ul>
<li><link anchor="NewFeatures230">New features in &XercesCName; 2.3.0</link></li>
<li><link anchor="API230">Public API Changes</link></li>
<ul>
<li><link anchor="NewAPI230">New Public API</link></li>
<li><link anchor="ModifiedAPI230">Modified Public API</link></li>
<li><link anchor="DeprecatedAPI230">Deprecated/Removed Public API</link></li>
</ul>
</ul>
<anchor name="NewFeatures230"/>
<s3 title="New features in &XercesCName; 2.3.0">
<ul>
<li>Experimental Implementation of Namespaces in XML 1.1 </li>
<li>Experimental Implementation of XML 1.1: in DOMWriter</li>
<li>More Schema 1.0 Errata Implementation</li>
<li>More DOM L3 Core Support</li>
<ul>
<li>DOMConfiguration</li>
<li>Document Normalization</li>
</ul>
<li>Plugable Memory Manager</li>
<li>Plugable Security Manager</li>
<li>Plugable Panic Handler</li>
<li>Logical Path Resolution</li>
</ul>
</s3>
<anchor name="API230"/>
<s3 title="Public API Changes">
<p>The following lists the public API changes between the &XercesCName;
2.2.0; and the &XercesCName; 2.3.0 releases
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
of the parser. </p>
<anchor name="NewAPI230"/>
<s4 title="New Public API">
<ul>
<li>To support additional DOM L3 functions, the following are added:</li>
<li>DOMDocument: getDOMConfiguration</li>
<li>DOMConfiguration class for document normalization.</li>
</ul>
</s4>
<anchor name="ModifiedAPI230"/>
<s4 title="Modified Public API">
<ul>
<li></li>
</ul>
</s4>
<anchor name="DeprecatedAPI230"/>
<s4 title="Deprecated/Removed Public API">
<ul>
<li>DOMDocument canSetNormalizationFeature, setNormalizationFeature, getNormalizationFeature, getErrorHandler, setErrorHandler removed</li>
</ul>
</s4>
</s3>
</s2>
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
<anchor name="Migrateto220"/>
<s2 title="Migrating from &XercesCName; 2.1.0 to &XercesCName; 2.2.0">
<p>The following section is a discussion of the technical differences between
&XercesCName; 2.1.0 code base and the &XercesCName; 2.2.0.</p>
<p>Topics discussed are:</p>
<ul>
<li><link anchor="NewFeatures220">New features in &XercesCName; 2.2.0</link></li>
<li><link anchor="CPPNamespace220">Using C++ Namespace</link></li>
<li><link anchor="API220">Public API Changes</link></li>
<ul>
<li><link anchor="NewAPI220">New Public API</link></li>
<li><link anchor="ModifiedAPI220">Modified Public API</link></li>
<li><link anchor="DeprecatedAPI220">Deprecated/Removed Public API</link></li>
</ul>
</ul>
<anchor name="NewFeatures220"/>
<s3 title="New features in &XercesCName; 2.2.0">
<ul>
<li>C++ Namespace Support</li>
<li>Schema 1.0 Errata Implementation</li>
<li>Experimental Implementation of XML 1.1</li>
<li>More DOM L3 Core Support:</li>
<ul>
<li>DOMNode: baseURI</li>
<li>DOMAttr: isId, getTypeInfo</li>
<li>DOMElement: setIdAttribute, setIdAttributeNS, setIdAttributeNode, getTypeInfo</li>
</ul>
<li>DOM Message: make use of the non-standard extension DOMImplementation::loadDOMExceptionMsg
to load the default error text message for the correspond Exception Code.</li>
<li>New feature XMLPlatformUtils::Initialize(const char* const locale) to set
the locale for message loader. See <jump href="program-others.html#SpecifylocaleforMessageLoader">
Specify locale for Message Loader</jump> for details</li>
<li>Support Build with ICU Message Loader, or Message Catalog Message Loader</li>
<li>RPM for Linux</li>
<li>390: Uniconv390 support</li>
<li>390: support record-oriented MVS datasets with the DOM Level 3 serialization APIs</li>
<li>Support for Linux/390</li>
<li>Performance: Break Scanner for different functionalities and many other performance improvement</li>
<li>New feature, "http://apache.org/xml/features/dom/byte-order-mark", allows user to enable
DOMWriter to write Byte-Order-Mark in the output XML stream,
See <jump href="program-dom.html#Byte-Order-Mark">
Xercesc Feature: Byte Order Mark</jump> for details</li>
</ul>
</s3>
<anchor name="CPPNamespace220"/>
<s3 title="Using C++ Namespace">
<p>&XercesCName; 2.2.0 now supports C++ Namespace. All &XercesCName;
classes, data and variables are defined in the &XercesCNamespace; namespace
if C++ Namespace support is ENABLED.</p>
<p>All the binary distributions of &XercesCName; 2.2.0 are now built with
C++ Namespace enabled. Therefore users' applications that links with the distributed
binary packages must namespace qualify all the &XercesCName; classes, data and variables.</p>
<p>See the Programming Guide <jump href="program-others.html#CPPNamespace">Using C++ Namespace</jump>
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
</s3>
<anchor name="API220"/>
<s3 title="Public API Changes">
<p>The following lists the public API changes between the &XercesCName;
2.1.0; and the &XercesCName; 2.2.0 releases
of the parser. </p>
<anchor name="NewAPI220"/>
<s4 title="New Public API">
<ul>
<li>To support additional DOM L3 functions, the following are added:</li>
<ul>
<li>DOMAttr: isId, getTypeInfo</li>
<li>DOMElement: setIdAttribute, setIdAttributeNS, setIdAttributeNode, getTypeInfo</li>
<li>Added DOMTypeInfo class for getTypeInfo class in DOMElement and DOMAttr</li>
<li>Added getDOMTypeInfoUri, getDOMTypeInfoName to XMLAttDef and XMLElementDecl for use in building DOMTypeInfo</li>
</ul>
<li>Added a non-standard extension DOMImplementation::loadDOMExceptionMsg to load the
default error message for the corresponding DOMException code.</li>
<li>XMLAttr: Added a constructor and a set method to allow creating/setting of
XMLAttr using a rawname.</li>
<li>Added XMLUri::getUriText to return the URI as a string specification.</li>
<li>Add XMLString::fixURI to transform an absolute path filename to standard URI form.</li>
<li>Added XMLString::equals for faster string comparison.</li>
<li>To allow users to tell the parser to force standard uri conformance,
the following are added:</li>
<ul>
<li>XercesDOMParser/DOMParser/SAXParser: get/setStandardUriConformant</li>
<li>and DOMBuilder/SAX2XMLReader will recognize the feature
http://apache.org/xml/features/standard-uri-conformant</li>
</ul>
<li>Add XMLURL::hasInvalidChar() to indicate if the URL has invalid char as per RFC standard</li>
<li>To allow users to enable/disable src offset calculation,
the following are added:</li>
<ul>
<li>XercesDOMParser/DOMParser/SAXParser: get/setCalculateSrcOfs</li>
<li>and DOMBuilder/SAX2XMLReader will recognize the feature
http://apache.org/xml/features/calculate-src-ofst</li>
</ul>
<li>To allow users to select the scanner when scanning XML documents,
the following are added:</li>
<ul>
<li>XercesDOMParser/DOMParser/SAXParser: useScanner</li>
<li>and DOMBuilder/SAX2XMLReader will recognize the property
http://apache.org/xml/properties/scannerName</li>
</ul>
<li>Added getSrcOffset to XercesDOMParser/DOMParser/SAXParser/DOMBuilder/SAX2XMLReader to
allow users to get the current src offset within the input source.</li>
</ul>
</s4>
<anchor name="ModifiedAPI220"/>
<s4 title="Modified Public API">
<ul>
<li>The following DOM functions are being added a const modifier.</li>
<ul>
<li>DOMImplementation::hasFeature</li>
<li>DOMNode: isSameNode, isEqualNode, compareTreePosition</li>
</ul>
<li>XMLPlatformUtils::Initialize() takes a parameter specifying locale
for message loader, with default value "en_US".</li>
<li>To fix [Bug 13641], the QName copy constructor is corrected to take
a reference as parameter, i.e. QName(const QName& qname).</li>
<li>To fix [Bug 12232], the QName operator== has been added a const modified.</li>
<li>Move XMLUri copy constructor and operator = as public.</li>
<li>Move XMLUri::isURIString as public.</li>
<li>For validation purpose, added two more default parameters to
XMLValidator::validateAttrValue.</li>
<li>To fix [Bug 15802], the getURIText of DOMParser/XercesDOMParser/SAXParser/SAX2XMLReader
are being added a const modifier.</li>
</ul>
</s4>
<anchor name="DeprecatedAPI220"/>
<s4 title="Deprecated/Removed Public API">
<ul>
<li>No Deprecated Public API in this release.</li>
</ul>
</s4>
</s3>
</s2>
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
<anchor name="Migrateto210"/>
<s2 title="Migrating from &XercesCName; 2.0.0 to &XercesCName; 2.1.0">
<p>The following section is a discussion of the technical differences between
&XercesCName; 2.0.0 code base and the &XercesCName; 2.1.0.</p>
<p>Topics discussed are:</p>
<ul>
<li><link anchor="NewFeatures210">New features in &XercesCName; 2.1.0</link></li>
<li><link anchor="API210">Public API Changes</link></li>
<ul>
<li><link anchor="NewAPI210">New Public API</link></li>
<li><link anchor="ModifiedAPI210">Modified Public API</link></li>
<li><link anchor="DeprecatedAPI210">Deprecated/Removed Public API</link></li>
</ul>
</ul>
<anchor name="NewFeatures210"/>
<s3 title="New features in &XercesCName; 2.1.0">
<ul>
<li>64 bit binaries distribution on Windows IA64 and Linux IA64</li>
<li>Support for Cygwin environment</li>
<li>DOM Level 3 DOMNode: compareTreePosition, lookupNamespaceURI, lookupNamespacePrefix and isDefaultNamespace</li>
<li>plus many more bug fixes</li>
</ul>
</s3>
<anchor name="API210"/>
<s3 title="Public API Changes">
<p>The following lists the public API changes between the &XercesCName;
2.0.0; and the &XercesCName; 2.1.0 releases
of the parser. </p>
<anchor name="NewAPI210"/>
<s4 title="New Public API">
<ul>
<li>To fix bug 7087, XMLEnumerator is added a virtual destructor.</li>
<li>To fix bug 11448, XMLNotationDecl::get/setBaseURI, and XMLEntityDecl::get/setBaseURI are added.</li>
</ul>
</s4>
<anchor name="ModifiedAPI210"/>
<s4 title="Modified Public API">
<ul>
<li>DOMNodeList: item, and getLength have been added a const modifier.</li>
<li>DOMNode: lookupNamespacePrefix, isDefaultNamespace, and lookupNamespaceURI have been added a const modifier.</li>
</ul>
</s4>
<anchor name="DeprecatedAPI210"/>
<s4 title="Deprecated/Removed Public API">
<ul>
<li>No Deprecated Public API in this release.</li>
</ul>
</s4>
</s3>
</s2>
<anchor name="Migrateto200"/>
<s2 title="Migrating from &XercesCName; 1.7.0 to &XercesCName; 2.0.0">
<p>The following section is a discussion of the technical differences between
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
&XercesCName; 1.7.0 code base and the &XercesCName; 2.0.0.</p>
<p>Topics discussed are:</p>
<ul>
<li><link anchor="NewFeatures200">New features in &XercesCName; 2.0.0</link></li>
<li><link anchor="LibraryChange200">Unix Library Name change</link></li>
<li><link anchor="DirChange200">DOM Reorganization</link></li>
<li><link anchor="Reuse200">Reuse Grammar becomes Grammar Caching</link></li>
<li><link anchor="API200">Public API Changes</link></li>
<ul>
<li><link anchor="NewAPI200">New Public API</link></li>
<li><link anchor="ModifiedAPI200">Modified Public API</link></li>
<li><link anchor="DeprecatedAPI200">Deprecated/Removed Public API</link></li>
</ul>
</ul>
<anchor name="NewFeatures200"/>
<s3 title="New features in &XercesCName; 2.0.0">
<ul>
<li>64 bit binaries distribution</li>
<li>Follow Unix Shared Library Naming Convention</li>
<li>Apache Recommended DOM C++ Binding</li>
<li>Experimental DOM Level 3 subset support, including DOMWriter and DOMBuilder</li>
<li>Grammar preparsing and Grammar caching</li>
<li>Optionally ignore loading of external DTD</li>
<li>Project files for Microsoft Visual C++ .Net</li>
<li>Codewarrior 8 support</li>
<li>Option to enable/disable strict IANA encoding name checking</li>
<li>plus many more bug fixes and performance enhancement</li>
</ul>
</s3>
<anchor name="LibraryChange200"/>
<s3 title="Unix Library Name Change">
<p>The &XercesCName; UNIX Library now follows the Unix Shared Library Naming Convention (libname.so.soname).
It is now called:</p>
<ul>
<li>AIX</li>
<ul>
<li>&XercesCUnixLib;&XercesCUnixSoName;.so</li>
<li>symbolic link: &XercesCUnixLib;.so ----> &XercesCUnixLib;&XercesCUnixVersion;.so</li>
<li>symbolic link: &XercesCUnixLib;&XercesCUnixVersion;.so ----> &XercesCUnixLib;&XercesCUnixSoName;.so</li>
</ul>
<li>Solaris / Linux</li>
<ul>
<li>&XercesCUnixLib;.so.&XercesCUnixSoName;</li>
<li>symbolic link: &XercesCUnixLib;.so ----> &XercesCUnixLib;.so.&XercesCUnixVersion;</li>
<li>symbolic link: &XercesCUnixLib;.so.&XercesCUnixVersion; ----> &XercesCUnixLib;.so.&XercesCUnixSoName;</li>
</ul>
<li>HP-UX</li>
<ul>
<li>&XercesCUnixLib;.sl.&XercesCUnixSoName;</li>
<li>symbolic link: &XercesCUnixLib;.sl ----> &XercesCUnixLib;.sl.&XercesCUnixVersion;</li>
<li>symbolic link: &XercesCUnixLib;.sl.&XercesCUnixVersion; ----> &XercesCUnixLib;.sl.&XercesCUnixSoName;</li>
</ul>
</ul>
</s3>
<anchor name="DirChange200"/>
<s3 title="DOM Reorganization">
<p>1. The old Java-like DOM is now deprecated, and all the associated files, including the headers
and DOMParser files are moved to <code>src/xercesc/dom/deprecated</code>. Users of the old
Java-like DOM are required to change all their #include lines to pick up the headers.
For example</p>
<source>
//old code
#include <xercesc/dom/DOM.hpp>
#include <xercesc/dom/DOM_Document.hpp>
#include <xercesc/parsers/DOMParser.hpp>
void test(char* xmlFile) {
DOMParser parser;
parser.parse(xmlFile);
DOM_Document doc = parser.getDocument();
:
return;
}
</source>
<p> should now change to </p>
<source>
//new code
#include <xercesc/dom/deprecated/DOM.hpp> //<==== change this include line
#include <xercesc/dom/deprecated/DOM_Document.hpp> //<==== change this include line
#include <xercesc/dom/deprecated/DOMParser.hpp> //<==== change this include line
// the rest is the same
void test(char* xmlFile) {
DOMParser parser;
parser.parse(xmlFile);
DOM_Document doc = parser.getDocument();
:
return;
}
</source>
<p>2. The Experimental IDOM is now renamed, and becomes the Apache Recommended DOM C++ Binding.
The following changes are made: </p>
<ul>
<li>class names are renamed from IDOM_XXXX to DOMXXXX, e.g. IDOM_Document to DOMDocument</li>
<li>and thus header files are renamed from IDOM_XXXX.hpp to DOMXXXX.hpp and are moved
to <code>src/xercesc/dom</code></li>
<li>the IDOMParser is renamed to XercesDOMParser. And thus the header
file is renamed as well</li>
<li>the rest is the same, see
<jump href="ApacheDOMC++Binding.html">Apache Recommended DOM C++ binding</jump>
and <jump href="program-dom.html">DOM Programming Guide</jump> for more programming
information</li>
</ul>
<p>Users of IDOM are required to change all their #include lines and do a global rename of
IDOMParser to XercesDOMParesr, and IDOM_XXXX to DOMXXXX. For example</p>
<source>
//old code
#include <xercesc/idom/IDOM.hpp>
#include <xercesc/idom/IDOM_Document.hpp>
#include <xercesc/parsers/IDOMParser.hpp>
void test(char* xmlFile) {
IDOMParser parser;
parser.parse(xmlFile);
IDOM_Document* doc = parser.getDocument();
:
return;
}
</source>
<p> should now change to </p>
<source>
//new code
#include <xercesc/dom/DOM.hpp> //<==== change this include line
#include <xercesc/dom/DOMDocument.hpp> //<==== change this include line
#include <xercesc/parsers/XercesDOMParser.hpp> //<==== change this include line
void test(char* xmlFile) {
XercesDOMParser parser; //<==== rename the IDOMParser
parser.parse(xmlFile);
DOMDocument* doc = parser.getDocument(); //<==== rename the IDOM_XXXX
:
return;
}
</source>
</s3>
<anchor name="Reuse200"/>
<s3 title="Reuse Grammar becomes Grammar Caching">
<p>The &XercesCName; 2.0.0 extends the "Reuse Grammar" support by replacing it with
a new feature called "Grammar Caching" which provides more flexibility in reusing grammars.
Users who used to do the following:</p>
<source>
XercesDOMParser parser;
// this is the first parse, just usual code as you do normal parse
// "firstXmlFile" has a grammar (schema or DTD) specified.
parser.parse(firstXmlFile);
// this is the second parse, by setting second parameter to true,
// the parser will reuse the grammar in the last parse
// (i.e. the one in "firstXmlFile")
// to validate the second "anotherXmlFile". Any grammar that is
// specified in anotherXmlFile is IGNORED.
//
// Note: The anotherXmlFile cannot have any DTD internal subset.
parser.parse(anotherXmlFile, true);
</source>
<p>should now use the features cacheGrammarFromParse and useCachedGrammarFromParse:</p>
<source>
XercesDOMParser parser;
// By setting cacheGrammarFromParse to true,
// the parser will cache any grammars encountered in the
// follow-on xml files, if not cached already
parser.cacheGrammarFromParse(true);
parser.parse(firstXmlFile);
// By setting useCachedGrammarFromParse to true,
// the parser will use all the previous cached grammars
// to validate the follow-on xml files if the cached
// grammar matches the one specified in anotherXmlFile.
//
// Note: The follow-on xml files cannot have any DTD internal subset.
parser.useCachedGrammarFromParse(true);
parser.parse(anotherXmlFile);
// This will flush the cached grammar pool
parser.resetCachedGrammarPool();
</source>
<p>Note there are a number of differences between "Reuse Grammar" and "Grammar Caching" </p>
<ol>
<li>"Reuse Grammar" ignores any grammar that is specified in anotherXmlFile and simply
reuse whatever stored in previous parse; while "Grammar Caching" will use the
cached grammar only if it matches the one specified in the anotherXmlFile.
If not match, then the new grammar is parsed.</li>
<li>"Reuse Grammar" can only reuse the grammar from previous parse; while "Grammar Caching"
can selectively cache many grammars from different parses and collect them all in a pool indexed
by targetNamespace (for Schema) or system id (for DTD).</li>
<li>Plus "Grammar Caching" has much more functionalities other than above
(like "Pre-parsing Grammar"). Please refer to
<jump href="program-others.html#GrammarCache">Preparsing Grammar and Grammar Caching
</jump> for more programming details.</li>
</ol>
</s3>
<anchor name="API200"/>
<s3 title="Public API Changes">
<p>The following lists the public API changes between the &XercesCName;
1.7.0; and the &XercesCName; 2.0.0 releases
of the parser. </p>
<anchor name="NewAPI200"/>
<s4 title="New Public API">
<ul>
<li>To support DOM Level 3, the following are added (see
<jump href="api.html">the API documentation page</jump> for details).</li>
<ul>
<li>DOMNode functions set/getUserData, isSameNode isEqualNode.</li>
<li>DOMDocument functions renameNode, get/setActualEncoding, get/setEncoding, get/setVersion, get/setStandalone, get/setDocumentURI.</li>
<li>DOMEntity functions get/setActualEncoding, get/setEncoding, get/setVersion.</li>
<li>classes AbstractDOMParser, DOMError, DOMErrorHandler, and DOMLocator.</li>
<li>classes DOMUserDataHandler, DOMImplementationRegistry and DOMImplementationSource.</li>
<li>classes DOMBuilder, DOMEntityResolver, DOMImplementationLS, DOMInputSource,
Wrapper4DOMInputSource and Wrapper4InputSource.</li>
<li>classes DOMWriter, DOMWriterFilter, LocalFileFormatTarget, StdOutFormatTarget,
and MemBufFormatTarget</li>
</ul>
<li>To support DOMWriter, the following PlatformUtils functions are added</li>
<ul>
<li>openFileToWrite, writeBufferToFile</li>
</ul>
<li>To have Apache Recommended DOM C++ Binding, the following are added (see
<jump href="ApacheDOMC++Binding.html">Apache Recommended DOM C++ binding).</jump></li>
<ul>
<li>function release() to fix Memory Management problem</li>
<li>classes DOMDocumentRange and DOMDocumentTraversal</li>
<li>XMLSize_t is used to represent unsigned integral type in DOM</li>
<li>IDOM_XXXX classes are renamed to DOMXXXX, and IDOMParser is renamed to XercesDOMParser
as described in <link anchor="DirChange200">DOM Reorganization</link></li>
<li>XercesDOMParser::adoptDocument is added so that document can optionally live
outside the parser.</li>
</ul>
<li>To support optionally load external DTD, the following are added:</li>
<ul>
<li>XercesDOMParser::set/getLoadExternalDTD</li>
<li>DOMParser::set/getLoadExternalDTD</li>
<li>SAXParser::set/getLoadExternalDTD</li>
<li>and SAX2XMLReader will recognize the feature
http://apache.org/xml/features/nonvalidating/load-external-dtd</li>
</ul>
<li>To support Preparsing Grammar and Grammar Caching, the following are added:</li>
<ul>
<li>XercesDOMParser/DOMParser/SAXParser functions loadGrammar, resetCachedGrammarPool,
cacheGrammarFromParse, isCachingGrammarFromParse, useCachedGrammarInParse,
isUsingCachedGrammarInParse.</li>
<li>SAX2XMLReader functions loadGrammar, resetCachedGrammarPool, and will recognize the features
http://apache.org/xml/features/validation/cache-grammarFromParse and
http://apache.org/xml/features/validation/use-cachedGrammarInParse.</li>
</ul>
<li>To support access to Grammar info, the following are added:</li>
<ul>
<li>XercesDOMParser/DOMParser/SAXParser/SAX2XMLReader functions getRootGrammar, getGrammar, getURIText.</li>
</ul>
<li>To support strict IANA encoding name checking, the following are added:</li>
<ul>
<li>class EncodingValidator.</li>
<li>PlatformUtils functions strictIANAEncoding, isStrictIANAEncoding.</li>
<li>XMLTransService functions strictIANAEncoding, isStrictIANAEncoding.</li>
</ul>
</ul>
</s4>
<anchor name="ModifiedAPI200"/>
<s4 title="Modified Public API">
<ul>
<li>SAXParser::getScanner() is moved from public to protected.</li>
<li>Grammar::getGrammarType has been added a const modifier.</li>
<li>Xerces features are renamed from XMLUni::fgSAX2XercesXXXX to XMLUni::fgXercesXXXX
so that they can be shared with DOM parser.</li>
<li>With the new Grammar Caching introduced, the the last parameter "reuseGrammar" in
the following API is dropped.
Users should now use the "Grammar Caching" feature as described in
<link anchor="Reuse200">Reuse Grammar becomes Grammar Caching</link>.</li>
<ul>
<li>(in Parser, SAXParser, DOMParser, and XercesDOMParser) </li>
<li>parse(const InputSource& source, const bool reuseGrammar = false);</li>
<li>parse(const XMLCh* const systemId, const bool reuseGrammar = false);</li>
<li>parse(const char* const systemId, const bool reuseGrammar = false);</li>
<li>(in SAXParser, DOMParser, and XercesDOMParser) </li>
<li>parseFirst(const InputSource& source, XMLPScanToken& toFill, const bool reuseGrammar = false);</li>
<li>parseFirst(const XMLCh* const systemId, XMLPScanToken& toFill, const bool reuseGrammar = false);</li>
<li>parseFirst(const char* const systemId, XMLPScanToken& toFill, const bool reuseGrammar = false);</li>
</ul>
</ul>
</s4>
<anchor name="DeprecatedAPI200"/>
<s4 title="Deprecated/Removed Public API">
<ul>
<li>The old Java-like DOM is now deprecated as described in
<link anchor="DirChange200">DOM Reorganization</link></li>
<li>SAX2XMLReader::setValidationConstraint. For consistency, SAX2XMLReader users should
set the feature http://apache.org/xml/features/validation-error-as-fatal" instead.</li>
<li>SAX2XMLReader::setExitOnFirstFatalError. For consistency, SAX2XMLReader users should
set the feature "http://apache.org/xml/features/continue-after-fatal-error" instead.</li>
<li>With the new Grammar Caching introduced, the following features will not be
recognized by the SAX2XMLReader:</li>
<ul>
<li>http://apache.org/xml/features/validation/reuse-grammar</li>
<li>http://apache.org/xml/features/validation/reuse-validator</li>
</ul>
</ul>
</s4>
</s3>
</s2>
<anchor name="Migrateto170"/>
<s2 title="Migrating from &XercesCName; 1.6.0 to 1.7.0">
<p>The following section is a discussion of the technical differences between
&XercesCName; 1.6.0 code base and the &XercesCName; 1.7.0 code base.</p>
<s3 title="New features in &XercesCName; 1.7.0">
<li>Support SAX2-ext's DeclHandler.</li>
<li>Directory sane_include reorganization: add sub-directory 'xercesc' to src / include folder.
See <link anchor="DirChange170">"Directory change in &XercesCName; 1.7.0"</link>
below for detail.</li>
<li>More IDOM test cases - port IDOMMemTest, and merge ThreadTest and IThreadTest.</li>
<li>Support IconvFBSD in multi-threading environment.</li>
<li>Use IDOM in schema processing for faster performance.</li>
<li>Add Project files for BCB6.</li>
<li>Port to Caldera (SCO) OpenServer.</li>
<li>Support building with new MacOSURLAccessCF NetAccessor that doesn't require
Carbon but can allow Xerces to live solely within CoreServices layer.</li>
</ul>
</s3>
<s3 title="Directory change in &XercesCName; 1.7.0">
<li>A new directory, <em>src/xercesc</em> is created to be the new parent directory of
all src's direct subdirectories.</li>
<li>And in the binary package, all the headers are distributed in <em>include/xercesc</em> directory.</li>
<li>Migration considerations:</li>
<ul>
<li>Windows application, <br/>
either change the <em>include directories </em> setting to
"..\..\..\..\..\src\<em>xercesc</em>" (Projects->settings->C/C++->Preprocessor), <br/>
or <br/>
change the relevant #include instances in the source/header files, accordingly, eg <br/>
#include <util/XMLString.hpp> be changed to <br/>
#include <<em>xercesc</em>/util/XMLString.hpp> </li>
<li>Unix application, <br/>
either change the <em>include search path </em> in the Makefile to
" -I <installroot>/include/<em>xercesc</em>", <br/>
or <br/>
change the relevant #include instances in the source/header files as shown above. </li>
</ul>
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
</s3>
<s3 title="Public API Changes in &XercesCName; 1.7.0">
<p>The following lists the public API changes between the &XercesCName;
1.7.0 and the &XercesCName; 1.7.0 releases
of the parser. </p>
<s4 title="New Public API">
<ul>
<li>Added SAX2-ext's DeclHandler class.
See <jump href="api.html">the API documentation page</jump> for details.</li>
<li>To support SAX2-ext's DeclHandler, the following new methods are added
in classes DefaultHandler and SAX2XMLReader:</li>
<ul>
<li>void DefaultHandler::elementDecl(const XMLCh* const name, const XMLCh* const model)</li>
<li>void DefaultHandler::attributeDecl(const XMLCh* const eName, const XMLCh* const aName,
const XMLCh* const type, const XMLCh* const mode, const XMLCh* const value)</li>
<li>void DefaultHandler::internalEntityDecl(const XMLCh* const name, const XMLCh* const value)</li>
<li>void DefaultHandler::externalEntityDecl(const XMLCh* const name, const XMLCh* const publicId,
const XMLCh* const systemId)</li>
<li>DeclHandler* SAX2XMLReader::getDeclarationHandler() const</li>
<li>void SAX2XMLReader::setDeclarationHandler(DeclHandler* const handler)</li>
</ul>
<li>To conform to DOM Level 2 specification, the following methods are added:</li>
<ul>
<li>DOM_Node DOM_NodeIterator::getRoot()</li>
<li>DOM_Node DOM_TreeWalker::getRoot()</li>
<li>bool DOM_Node::hasAttributes() const</li>
<li>bool DOM_Element::hasAttribute(const DOMString &name) const</li>
<li>bool DOM_Element::hasAttributeNS(const DOMString &namespaceURI,
const DOMString &localName) const</li>
<li>IDOM_Node* IDOM_NodeIterator::getRoot()</li>
<li>IDOM_Node* IDOM_TreeWalker::getRoot()</li>
<li>bool IDOM_Node::hasAttributes() const</li>
<li>bool IDOM_Element::hasAttribute(const XMLCh* name) const</li>
<li>bool IDOM_Element::hasAttributeNS(const XMLCh* namespaceURI,
const XMLCh* localName) const</li>
</ul>
<li>To fix [Bug 5570], a copy constructor is added to DOM_Range</li>
</ul>
</s4>
<s4 title="Modified Public API">
<ul>
<li>To conform to the SAX2 specification, the namespace-prefixes feature
in SAX2 is set to off as default.</li>
<li>To fix [Bug 6330], the Base64::encode and Base64::decode have been modified
as follows</li>
<ul>
<li>static XMLByte* Base64::encode(const XMLByte* const inputData,
const unsigned int inputLength,
unsigned int* outputLength);</li>
<li>static XMLByte* Base64::decode(const XMLByte* const inputData,
unsigned int* outputLength);</li>
<li>static XMLCh* decode(const XMLCh* const inputData,
unsigned int* outputLength);</li>
</ul>
<li>To conform to DOM Level 2 specification, the DOM_Node::supports and IDOM_Node::supports
are modified to</li>
<ul>
<li>bool DOM_Node::isSupported(const DOMString &feature, const DOMString &version) const</li>
<li>bool IDOM_Node::isSupported(const XMLCh* feature, const XMLCh* version) const</li>
</ul>
</ul>
</s4>
<s4 title="Deprecated Public API">
<ul>
<li>No Deprecated Public API in this release.</li>
</ul>
</s4>
</s3>
<anchor name="Migrateto160"/>
<s2 title="Migrating from &XercesCName; 1.5.2 to 1.6.0">
<p>The following section is a discussion of the technical differences between
&XercesCName; 1.5.2 code base and the &XercesCName; 1.6.0 code base.</p>
<s3 title="New features in &XercesCName; 1.6.0">
<ul>
<li>Full Schema support is available in this release.
See <jump href="schema.html">the Schema page</jump> for details.</li>
<li>New sample SEnumVal to show how to enumerate the markup decls in a Schema Grammar is added.</li>
</ul>
<s3 title="Public API Changes in &XercesCName; 1.6.0">
<p>The following lists the public API changes between the &XercesCName;
1.5.2 and the &XercesCName; 1.6.0 releases
<s4 title="New Public API">
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
<ul>
<li>It should not be a fatal error if a schema InputSource is not found.
Add the following new methods:</li>
<ul>
<li>const bool InputSource::getIssueFatalErrorIfNotFound() const</li>
<li>void InputSource::setIssueFatalErrorIfNotFound(const bool flag</li>
</ul>
<li>Allow code to take advantage of the fact that the length of the prefix and
local name are known when constructing the QName.
Add the following new methods:</li>
<ul>
<li>void QName::setNPrefix(const XMLCh*, const unsigned int)</li>
<li>void QName::setNLocalPart(const XMLCh*, const unsigned int)</li>
</ul>
<li>To support schemaLocation and noNamespaceSchemaLocation to be specified outside the
instance document, the following new methods are added:</li>
<ul>
<li>XMLCh* DOMParser::getExternalSchemaLocation() const</li>
<li>XMLCh* DOMParser::getExternalNoNamespaceSchemaLocation() const</li>
<li>void DOMParser::setExternalSchemaLocation(const XMLCh* const schemaLocation)</li>
<li>void DOMParser::setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation)</li>
<li>XMLCh* IDOMParser::getExternalSchemaLocation() const</li>
<li>XMLCh* IDOMParser::getExternalNoNamespaceSchemaLocation() const</li>
<li>void IDOMParser::setExternalSchemaLocation(const XMLCh* const schemaLocation)</li>
<li>void IDOMParser::setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation)</li>
<li>XMLCh* SAXParser::getExternalSchemaLocation() const</li>
<li>XMLCh* SAXParser::getExternalNoNamespaceSchemaLocation() const</li>
<li>void SAXParser::setExternalSchemaLocation(const XMLCh* const schemaLocation)</li>
<li>void SAXParser::setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation)</li>
<li>and the following properties are recognized by SAX2XMLReader:</li>
<ul>
<li>http://apache.org/xml/properties/schema/external-schemaLocation</li>
<li>http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation</li>
</ul>
</ul>
<li>To support identity constraints, the following new method is added:</li>
<ul>
<li>QName* XMLAttr::getAttName() const</li>
</ul>
</ul>
<s4 title="Modified Public API">
<ul>
<li>To support attribute constraint checking, the constant values in XMLAttDef::DefAttTypes have been re-ordered.</li>
</ul>
<s4 title="Deprecated Public API">
<ul>
<li>Root Element check is moved from XMLValidator to XMLScanner. Thus XMLValidator::checkRootElement() is deprecated.</li>
</ul>
<anchor name="Migrateto152"/>
<s2 title="Migrating from &XercesCName; 1.4.0 to 1.5.2">
<p>The following section is a discussion of the technical differences between
&XercesCName; 1.4.0 code base and the &XercesCName; 1.5.2 code base.</p>
<s3 title="New features in &XercesCName; 1.5.2">
<p>Schema subset support and an experimental IDOM are available
in this release.
</p>
<s4 title="Schema Subset Support">
<ul>
<li>New function "setDoSchema" is added to DOM/SAX parser.</li>
<li>New feature "http://apache.org/xml/features/validation/schema" is recognized by SAX2XMLReader.</li>
<li>New classes such as SchemaValidator, TraverseSchema ... are added.</li>
<li>The Scanner is enhanced to process schema.</li>
<li>New sample data files personal-schema.xml and personal.xsd.</li>
<li>New command line option "-s" for samples.</li>
</ul>
<p>
See <jump href="schema.html">the Schema page</jump> for details.
</p>
<s4 title="Experimental IDOM">
<p>The experimental IDOM API is a new design of the C++ DOM API. If you would like
to migrate from DOM to the experimental IDOM, please refer to
<jump href="program-idom.html">
IDOM programming guide.</jump> Please note that this experimental IDOM API is only
a prototype and is subject to change.
</p>
<s3 title="Changes required to migrate to &XercesCName; 1.5.2">
<p>There are some architectural changes between the &XercesCName;
1.4.0 and the &XercesCName; 1.5.2 releases
of the parser, and as a result, some code has undergone restructuring
as shown below. </p>
<s4 title="Validator directory Reorganization">
<ul>
<li>common content model files such as DFAContentModel ...