Skip to content
Snippets Groups Projects
migration_archive.xml 57.9 KiB
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>
PeiYong Zhang's avatar
PeiYong Zhang committed
        <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>
Tinny Ng's avatar
Tinny Ng committed
        <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>

	<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>
    
PeiYong Zhang's avatar
PeiYong Zhang committed
    <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>
    
    <anchor name="Migrateto230"/>
    <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
           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>
        
Tinny Ng's avatar
Tinny Ng committed
    <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
Tinny Ng's avatar
Tinny Ng committed
           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>
Tinny Ng's avatar
Tinny Ng committed

        <p>See the Programming Guide <jump href="program-others.html#CPPNamespace">Using C++ Namespace</jump>
           for details.</p>
Tinny Ng's avatar
Tinny Ng committed

    </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&amp; 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>
        
    <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>

Tinny Ng's avatar
Tinny Ng committed
    <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
Tinny Ng's avatar
Tinny Ng committed
      &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                      ----&gt; &XercesCUnixLib;&XercesCUnixVersion;.so</li>
              <li>symbolic link: &XercesCUnixLib;&XercesCUnixVersion;.so  ----&gt; &XercesCUnixLib;&XercesCUnixSoName;.so</li>
            </ul>
            <li>Solaris / Linux</li>
            <ul>
              <li>&XercesCUnixLib;.so.&XercesCUnixSoName;</li>
              <li>symbolic link: &XercesCUnixLib;.so                      ----&gt; &XercesCUnixLib;.so.&XercesCUnixVersion;</li>
              <li>symbolic link: &XercesCUnixLib;.so.&XercesCUnixVersion; ----&gt; &XercesCUnixLib;.so.&XercesCUnixSoName;</li>
            </ul>
            <li>HP-UX</li>
            <ul>
              <li>&XercesCUnixLib;.sl.&XercesCUnixSoName;</li>
              <li>symbolic link: &XercesCUnixLib;.sl                      ----&gt; &XercesCUnixLib;.sl.&XercesCUnixVersion;</li>
              <li>symbolic link: &XercesCUnixLib;.sl.&XercesCUnixVersion; ----&gt; &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 &lt;xercesc/dom/DOM.hpp&gt;
#include &lt;xercesc/dom/DOM_Document.hpp&gt;
#include &lt;xercesc/parsers/DOMParser.hpp&gt;

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 &lt;xercesc/dom/deprecated/DOM.hpp&gt;          //&lt;==== change this include line
#include &lt;xercesc/dom/deprecated/DOM_Document.hpp&gt; //&lt;==== change this include line
#include &lt;xercesc/dom/deprecated/DOMParser.hpp&gt;    //&lt;==== 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 &lt;xercesc/idom/IDOM.hpp&gt;
#include &lt;xercesc/idom/IDOM_Document.hpp&gt;
#include &lt;xercesc/parsers/IDOMParser.hpp&gt;

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 &lt;xercesc/dom/DOM.hpp&gt;                  //&lt;==== change this include line
#include &lt;xercesc/dom/DOMDocument.hpp&gt;          //&lt;==== change this include line
#include &lt;xercesc/parsers/XercesDOMParser.hpp&gt;  //&lt;==== change this include line

void test(char* xmlFile) {
    XercesDOMParser parser;                           //&lt;==== rename the IDOMParser
    parser.parse(xmlFile);
    DOMDocument* doc = parser.getDocument();          //&lt;==== 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&amp; 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&amp; source, XMLPScanToken&amp;  toFill, const bool reuseGrammar = false);</li>
                   <li>parseFirst(const XMLCh* const systemId, XMLPScanToken&amp;  toFill, const bool reuseGrammar = false);</li>
                   <li>parseFirst(const char* const systemId, XMLPScanToken&amp;  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.
Tinny Ng's avatar
Tinny Ng committed
            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>

Tinny Ng's avatar
Tinny Ng committed
    <anchor name="DirChange170"/>
    <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 &lt;util/XMLString.hpp&gt; be changed to <br/>
                  #include &lt;<em>xercesc</em>/util/XMLString.hpp&gt; </li>
              <li>Unix application, <br/>
                  either change the <em>include search path </em> in the Makefile to
                  " -I &lt;installroot&gt;/include/<em>xercesc</em>", <br/>
                  or <br/>
                  change the relevant #include instances in the source/header files as shown above. </li>
            </ul>
    </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 &amp;name) const</li>
                <li>bool DOM_Element::hasAttributeNS(const DOMString &amp;namespaceURI,
                                const DOMString &amp;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 &amp;feature, const DOMString &amp;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">
            <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 ...