Question

Background

We have dependencies to several Xalan and Xerces versions in our rather large C++ system. This has accumulated over the years, and is not optimal for several reasons.

Now we're migrating from Solaris to Linux, and we think it makes sense to consolidate third party dependencies to a minimum.

We've determined that we still need Xerces 2.8 and Xerces 3.x. And Xalan 1.x

Target platform is RHEL6.

Problem

From RHEL repo we can get Xerces 3.0 and Xalan 1.10 (build against Xerces 3.0)

We've installed Xerces 2.8, under /usr/local...

We can't figure out how Xalan is supposed to work with Xerces (link wise). That is:

  • Do we need two Xalan libraries, one linked against 3.x and one against 2.8?
  • Can we have one Xalan version, let's say 1.11, that (by some magic) works with both the xerces versions?

We can't be the only one with this problem, or are we just idiots? (which would be the best scenario... :))

Was it helpful?

Solution

From what I've just read at xerces.apache.org , Xerces 2.X and Xerces 3.x have different API's and therefore you'll need to link with one OR the other.

And as you can see from xalan.apache.org:

"The Xalan-C/C++ 1.11 library requires the Xerces-C/C++ XML Parser 3.0 or newer, version 3.1.1 is preferred.", while Xalan 1.10 requires Xerces 2.7.0 (will probably work with 2.8.0).

So yes, you will need two different versions of Xalan libraries, unless you can resolve your dependencies to Xalan 1.11.0 only, in which case you can have only one installed Xalan and one Xerces.

OTHER TIPS

Probably most of all problems of xerces + xalan are because of xerces definition of XML character "XMLCh" in Xerces_autoconf_config.hpp (generated header). I have been trying to build on windows xerces 3.2.2 and xalan 1.11, and faced types missmaching... E.g., DirectoryEnumerator.hpp, struct FindFileStruct, has function:

const XalanDOMChar* getName() const
{
  return name;
}

name is "wchar_t name[260];" from corecrt_wio.h, struct _wfinddata64i32_t (it is Windows part...). XalanDOMChar is typedef of "XMLCh".

For some reason xerces 3.1.1 generates XMLCh as "wchar_t", but xerces 3.2.2 - as "char16_t". And xalan has some code that is oriented on "wchar_t"...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top