http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Home

Readme
Charter
Release Info

Installation
Download
Build Instructions

Programming
Samples
FAQs

API Reference
DOM C++ Binding
Migration Guide

Feedback
Bug-Reporting
Mailing Lists

Source Repository
Applications

Migrating to earlier Releases
 

Migrating from Xerces-C++ 2.6.0 to Xerces-C++ 2.7.0
 

The following section is a discussion of the technical differences between Xerces-C++ 2.6.0 code base and the Xerces-C++ 2.7.0.

Topics discussed are:

New features in Xerces-C++ 2.7.0
 
  • Feature to not generate XML Schema annotations. That is, not to add them to the grammar. If you don't need annotations you may want to turn on this feature to avoid memory bloat for XML Schemas that use annotations heavily.
  • Option to skip regenerating the XML Schema annotations when deserializing a grammar. If you don't need annotations you may want to turn on this option to avoid memory bloat for XML Schemas that use annotations heavily.
  • Feature to not perform default entity resolution. When the entityResolver returns NULL, the parser doesn't try to resolve the entity externally.
  • Feature to do schema-only validation even if there is a DTD.

Public API Changes
 

The following lists the public API changes between the Xerces-C++ 2.6.0; and the Xerces-C++ 2.7.0 releases of the parser.

New Public API
 
  • XMLString: subString, compareIStringASCII, lowercaseASCII, uppercaseASCII
  • RefHash2KeysTableOf: rehashing support
  • XMemory: placement new and delete
  • SAX2XMLFilter

Modified Public API
 

Deprecated/Removed Public API
 



Migrating from Xerces-C++ 2.5.0 to Xerces-C++ 2.6.0
 

The following section is a discussion of the technical differences between Xerces-C++ 2.5.0 code base and the Xerces-C++ 2.6.0.

Topics discussed are:

  • New features in Xerces-C++ 2.6.0
  • Public API Changes
    • New Public API
    • Modified Public API
    • Deprecated/Removed Public API
    • Please note the following source code incompatibility: Rename VALUE_CONSTRAINT enumeration values in XSConstants.hpp due to conflict with system header. New values are VALUE_CONSTRAINT_NONE, VALUE_CONSTRAINT_DEFAULT and VALUE_CONSTRAINT_FIXED. Old values are VC_NONE, VC_DEFAULT and VC_FIXED.
    • Also note that if you have implemented your own XMLGrammarPool implementation, that the original getXSModel has been marked deprecated and a new method, of the same name, that takes a bool parameter has been added. This new getXSModel needs to always return an XSModel.
New features in Xerces-C++ 2.6.0
 
  • Reduce footprint of DLL by building the deprecated DOM as a separate library
  • Improve packaging scripts
  • Enable ID's to work on all kinds of schema components
  • Add messages to DOMExceptions along with the error code
  • Improve annotation error-reporting capabilities
  • Make grammar caching work with DTD internal subsets
  • Bring parser up to the XML 1.0 3rd Edition
  • Update to the XML 1.1 recommendation
  • Add new method to DOMDocument so that DOM level-2 style DOMDocumentTypes (which have a DOMDocument to own them) can be created
  • Feature for disabling identity constraints
  • Update schema errata
  • Provide means to get actual values out of PSVI/schema component model
  • Synthesize annotation components for non-schema attributes
  • Expose partial PSVIElement information at the start element call
  • Externalize validation, actual/canonical value production for arbitrary strings
  • Laxly validate schema annotations
  • Upgrade to ICU 3.0
  • Handle elements with a large number of attributes more efficiently

Public API Changes
 

The following lists the public API changes between the Xerces-C++ 2.5.0; and the Xerces-C++ 2.6.0 releases of the parser.

New Public API
 
  • XSValue
  • IdentityConstraintHandler
  • XMLBufferFullHandler
  • XMLString: removeChar, isValidNOTATION
  • XMLUri: normalizeUri
  • PSVIHandler: handlePartialElementPSVI
  • RefHash family of classes: getHashModulus
  • XSAnnotation: setline/col and systemid
  • XMLReader: handeEOL
  • XMLChar: isValidNmToken
  • XMLBigDecimal: parseDecimal, getIntVal
  • HexBin: getCanonicalRepresentation, decode
  • Base64: getCanonicalRepresentation, decode
  • XMLBigInteger: compareValues
  • XMLAbstractDoubleFloat: isDataConverted, getValue, isDataOverFlowed
  • PSVIItem: getActualValue
  • XSSimpleTypeDefinition: getDatatypeValidator
  • RefHash2KeysTableOf: transferElement
  • XMLGrammarPool: getXSModel

Modified Public API
 
  • XSerializeEngine constructor
  • MACUnicodeConverters

Deprecated/Removed Public API
 
  • XSerializeEngine constructor
  • DTDAttDef: getDOMTypeInfoName, getDOMTypeInfoUri
  • DTDElementDecl: getDOMTypeInfoName, getDOMTypeInfoUri
  • SchemaAttDef: setAnyDatatypeValidator
  • UnionDatatypeValidator: getMemberTypeName, getMemberTypeUri, getMemberTypeAnonymous, getMemberTypeValidator
  • XMLAttr: getValidatingTypeURI, getValidatingTypeName, setDatatypeValidator, setSchemaValidated
  • ComplexTypeInfo: setContentModel
  • XMLGrammarPool: getXSModel
  • SAXParser, mark this class deprecated



Migrating from Xerces-C++ 2.4.0 to Xerces-C++ 2.5.0
 

The following section is a discussion of the technical differences between Xerces-C++ 2.4.0 code base and the Xerces-C++ 2.5.0.

Topics discussed are:

New features in Xerces-C++ 2.5.0
 
  • Fix duplicate attribute detection when namespaces are disabled
  • Stricter use of static memory manager for static data only
  • PSVI bug fix and enhencement
  • ThreadTest with grammar caching
  • Re-pluggable Panic Handler
  • Enhenced mutex creation to impove thread safety
  • Intrinsic transcoding support for 390.
  • Canonical Representation Support
  • New sample SCMPrint
  • New sample PSVIWriter
  • New test XSerializerTest

Public API Changes
 

The following lists the public API changes between the Xerces-C++ 2.4.0; and the Xerces-C++ 2.5.0 releases of the parser.

New Public API
 

Modified Public API
 

Deprecated/Removed Public API
 



Migrating from Xerces-C++ 2.3.0 to Xerces-C++ 2.4.0
 

The following section is a discussion of the technical differences between Xerces-C++ 2.3.0 code base and the Xerces-C++ 2.4.0.

Topics discussed are:

New features in Xerces-C++ 2.4.0
 
  • PSVI
  • Performance enhancement
  • Stateless Grammar
  • Grammar Serialization/Deserialiation

Public API Changes
 

The following lists the public API changes between the Xerces-C++ 2.3.0; and the Xerces-C++ 2.4.0 releases of the parser.

New Public API
 
  • PSVI related
  • Grammar serialization/deserialization related

Modified Public API
 

Deprecated/Removed Public API
 
  • XMLAttDef: getProvided, getDOMTypeInfoUri, getDOMTypeInfoName, setProvided
  • XMLAttDefList: hasMoreElements, nextElement, Reset
  • DTDAttDefList: hasMoreElements, nextElement, Reset
  • SchemaAttDefList: hasMoreElements, nextElement, Reset
  • XMLElementDecl: LookupOpts
  • XMLNumber family: toString
  • ENTITYDatatypeValidator: setEntityDeclPool
  • IDDatatypeValidator: setIDRefList
  • IDREFDatatypeValidator: setIDRefList
  • GeneralAttributeCheck: setIDRefList
  • SchemaGrammar: getIDRefList
  • SchemaElementDecl: all non thread safe methods
  • SchemaAttDef: getters
  • DTDGrammar: getRootElemId



Migrating from Xerces-C++ 2.2.0 to Xerces-C++ 2.3.0
 

The following section is a discussion of the technical differences between Xerces-C++ 2.2.0 code base and the Xerces-C++ 2.3.0.

Topics discussed are:

New features in Xerces-C++ 2.3.0
 
  • Experimental Implementation of Namespaces in XML 1.1
  • Experimental Implementation of XML 1.1: in DOMWriter
  • More Schema 1.0 Errata Implementation
  • More DOM L3 Core Support
    • DOMConfiguration
    • Document Normalization
  • Plugable Memory Manager
  • Plugable Security Manager
  • Plugable Panic Handler
  • Logical Path Resolution

Public API Changes
 

The following lists the public API changes between the Xerces-C++ 2.2.0; and the Xerces-C++ 2.3.0 releases of the parser.

New Public API
 
  • To support additional DOM L3 functions, the following are added:
  • DOMDocument: getDOMConfiguration
  • DOMConfiguration class for document normalization.

Modified Public API
 

Deprecated/Removed Public API
 
  • DOMDocument canSetNormalizationFeature, setNormalizationFeature, getNormalizationFeature, getErrorHandler, setErrorHandler removed



Migrating from Xerces-C++ 2.1.0 to Xerces-C++ 2.2.0
 

The following section is a discussion of the technical differences between Xerces-C++ 2.1.0 code base and the Xerces-C++ 2.2.0.

Topics discussed are:

New features in Xerces-C++ 2.2.0
 
  • C++ Namespace Support
  • Schema 1.0 Errata Implementation
  • Experimental Implementation of XML 1.1
  • More DOM L3 Core Support:
    • DOMNode: baseURI
    • DOMAttr: isId, getTypeInfo
    • DOMElement: setIdAttribute, setIdAttributeNS, setIdAttributeNode, getTypeInfo
  • DOM Message: make use of the non-standard extension DOMImplementation::loadDOMExceptionMsg to load the default error text message for the correspond Exception Code.
  • New feature XMLPlatformUtils::Initialize(const char* const locale) to set the locale for message loader. See Specify locale for Message Loader for details
  • Support Build with ICU Message Loader, or Message Catalog Message Loader
  • RPM for Linux
  • 390: Uniconv390 support
  • 390: support record-oriented MVS datasets with the DOM Level 3 serialization APIs
  • Support for Linux/390
  • Performance: Break Scanner for different functionalities and many other performance improvement
  • 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 Xercesc Feature: Byte Order Mark for details

Using C++ Namespace
 

Xerces-C++ 2.2.0 now supports C++ Namespace. All Xerces-C++ classes, data and variables are defined in the xercesc namespace if C++ Namespace support is ENABLED.

All the binary distributions of Xerces-C++ 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 Xerces-C++ classes, data and variables.

See the Programming Guide Using C++ Namespace for details.


Public API Changes
 

The following lists the public API changes between the Xerces-C++ 2.1.0; and the Xerces-C++ 2.2.0 releases of the parser.

New Public API
 
  • To support additional DOM L3 functions, the following are added:
    • DOMAttr: isId, getTypeInfo
    • DOMElement: setIdAttribute, setIdAttributeNS, setIdAttributeNode, getTypeInfo
    • Added DOMTypeInfo class for getTypeInfo class in DOMElement and DOMAttr
    • Added getDOMTypeInfoUri, getDOMTypeInfoName to XMLAttDef and XMLElementDecl for use in building DOMTypeInfo
  • Added a non-standard extension DOMImplementation::loadDOMExceptionMsg to load the default error message for the corresponding DOMException code.
  • XMLAttr: Added a constructor and a set method to allow creating/setting of XMLAttr using a rawname.
  • Added XMLUri::getUriText to return the URI as a string specification.
  • Add XMLString::fixURI to transform an absolute path filename to standard URI form.
  • Added XMLString::equals for faster string comparison.
  • To allow users to tell the parser to force standard uri conformance, the following are added:
    • XercesDOMParser/DOMParser/SAXParser: get/setStandardUriConformant
    • and DOMBuilder/SAX2XMLReader will recognize the feature http://apache.org/xml/features/standard-uri-conformant
  • Add XMLURL::hasInvalidChar() to indicate if the URL has invalid char as per RFC standard
  • To allow users to enable/disable src offset calculation, the following are added:
    • XercesDOMParser/DOMParser/SAXParser: get/setCalculateSrcOfs
    • and DOMBuilder/SAX2XMLReader will recognize the feature http://apache.org/xml/features/calculate-src-ofst
  • To allow users to select the scanner when scanning XML documents, the following are added:
    • XercesDOMParser/DOMParser/SAXParser: useScanner
    • and DOMBuilder/SAX2XMLReader will recognize the property http://apache.org/xml/properties/scannerName
  • Added getSrcOffset to XercesDOMParser/DOMParser/SAXParser/DOMBuilder/SAX2XMLReader to allow users to get the current src offset within the input source.

Modified Public API
 
  • The following DOM functions are being added a const modifier.
    • DOMImplementation::hasFeature
    • DOMNode: isSameNode, isEqualNode, compareTreePosition
  • XMLPlatformUtils::Initialize() takes a parameter specifying locale for message loader, with default value "en_US".
  • To fix [Bug 13641], the QName copy constructor is corrected to take a reference as parameter, i.e. QName(const QName& qname).
  • To fix [Bug 12232], the QName operator== has been added a const modified.
  • Move XMLUri copy constructor and operator = as public.
  • Move XMLUri::isURIString as public.
  • For validation purpose, added two more default parameters to XMLValidator::validateAttrValue.
  • To fix [Bug 15802], the getURIText of DOMParser/XercesDOMParser/SAXParser/SAX2XMLReader are being added a const modifier.

Deprecated/Removed Public API
 
  • No Deprecated Public API in this release.



Migrating from Xerces-C++ 2.0.0 to Xerces-C++ 2.1.0
 

The following section is a discussion of the technical differences between Xerces-C++ 2.0.0 code base and the Xerces-C++ 2.1.0.

Topics discussed are:

New features in Xerces-C++ 2.1.0
 
  • 64 bit binaries distribution on Windows IA64 and Linux IA64
  • Support for Cygwin environment
  • DOM Level 3 DOMNode: compareTreePosition, lookupNamespaceURI, lookupNamespacePrefix and isDefaultNamespace
  • plus many more bug fixes

Public API Changes
 

The following lists the public API changes between the Xerces-C++ 2.0.0; and the Xerces-C++ 2.1.0 releases of the parser.

New Public API
 
  • To fix bug 7087, XMLEnumerator is added a virtual destructor.
  • To fix bug 11448, XMLNotationDecl::get/setBaseURI, and XMLEntityDecl::get/setBaseURI are added.

Modified Public API
 
  • DOMNodeList: item, and getLength have been added a const modifier.
  • DOMNode: lookupNamespacePrefix, isDefaultNamespace, and lookupNamespaceURI have been added a const modifier.

Deprecated/Removed Public API
 
  • No Deprecated Public API in this release.



Migrating from Xerces-C++ 1.7.0 to Xerces-C++ 2.0.0
 

The following section is a discussion of the technical differences between Xerces-C++ 1.7.0 code base and the Xerces-C++ 2.0.0.

Topics discussed are:

New features in Xerces-C++ 2.0.0
 
  • 64 bit binaries distribution
  • Follow Unix Shared Library Naming Convention
  • Apache Recommended DOM C++ Binding
  • Experimental DOM Level 3 subset support, including DOMWriter and DOMBuilder
  • Grammar preparsing and Grammar caching
  • Optionally ignore loading of external DTD
  • Project files for Microsoft Visual C++ .Net
  • Codewarrior 8 support
  • Option to enable/disable strict IANA encoding name checking
  • plus many more bug fixes and performance enhancement

Unix Library Name Change
 

The Xerces-C++ UNIX Library now follows the Unix Shared Library Naming Convention (libname.so.soname). It is now called:

  • AIX
    • libxerces-c28.0.so
    • symbolic link: libxerces-c.so ----> libxerces-c28.so
    • symbolic link: libxerces-c28.so ----> libxerces-c28.0.so
  • Solaris / Linux
    • libxerces-c.so.28.0
    • symbolic link: libxerces-c.so ----> libxerces-c.so.28
    • symbolic link: libxerces-c.so.28 ----> libxerces-c.so.28.0
  • HP-UX
    • libxerces-c.sl.28.0
    • symbolic link: libxerces-c.sl ----> libxerces-c.sl.28
    • symbolic link: libxerces-c.sl.28 ----> libxerces-c.sl.28.0

DOM Reorganization
 

1. The old Java-like DOM is now deprecated, and all the associated files, including the headers and DOMParser files are moved to src/xercesc/dom/deprecated. Users of the old Java-like DOM are required to change all their #include lines to pick up the headers. For example

//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;
}

should now change to

//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;
}

2. The Experimental IDOM is now renamed, and becomes the Apache Recommended DOM C++ Binding. The following changes are made:

  • class names are renamed from IDOM_XXXX to DOMXXXX, e.g. IDOM_Document to DOMDocument
  • and thus header files are renamed from IDOM_XXXX.hpp to DOMXXXX.hpp and are moved to src/xercesc/dom
  • the IDOMParser is renamed to XercesDOMParser. And thus the header file is renamed as well
  • the rest is the same, see Apache Recommended DOM C++ binding and DOM Programming Guide for more programming information

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

//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;
}

should now change to

//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;
}

Reuse Grammar becomes Grammar Caching
 

The Xerces-C++ 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:


      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);

should now use the features cacheGrammarFromParse and useCachedGrammarFromParse:

      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();

Note there are a number of differences between "Reuse Grammar" and "Grammar Caching"

  1. "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.
  2. "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).
  3. Plus "Grammar Caching" has much more functionalities other than above (like "Pre-parsing Grammar"). Please refer to Preparsing Grammar and Grammar Caching for more programming details.

<
Public API Changes