Ola Theander wrote:
Dear subscribers
I’m currently working on a port of an application from Solaris to
Windows that’s using Xalan 1.6. Since one of the tasks of the port is to
build the application using the new Visual Studio 2008 (VS 2008), i.e.
Visual C++ 9.0, I’ve decided to also upgrade the Xalan library to the
1.10 version which builds smoothly using VS 2008.
Unfortunately there are some compatibility issues between the ported
application and Xalan 1.10. For instance, previously there was a pure
virtual clone()-method on the XObject-class which has been removed in
later version, specifically with the check-in of the first
implementation of the “pluggable memory management”. My question is, is
there any other similar or replacement method for cloning objects? The
ported application makes heavy use of this cloning ability by methods
that clone an object provided with a XObject-pointer. As I see it, to
remedy this can be slightly troublesome since the methods themselves are
not aware of the actual class-type that’s cloned, and without the
clone()-method I guess the method need to know which instance-type to
create. Modifying the application to skip the cloning and use the
provided object will probably introduce some bugs since some of the
objects seem to be using reference counting.
Unfortunately, I don't remember the full details of why the clone()
function was removed. However, I do remember that it was tricky to make it
work with pluggable memory management, and we no longer needed to clone
things within the implementation.
Any information that could point me into the direction of a smooth
solution would be most appreciated since I’m not very familiar with the
Xalan-libraries.
Without knowing why your application is cloning XObjects, it's hard to
suggest how you might proceed. Perhaps it's saving the result of an XPath
query? If that's the case, it's trivial to simply save the value a
particular XObject instance holds. It's not pretty, but it will work.
If you can provide a few more details about what your application does with
the cloned XObjects, that would help.
Dave