[EMAIL PROTECTED] wrote:
            All,

            I had upgraded XALAN 1.7 to 1.9 on HP UNIX machine today.
            After upgrading, I am getting the following compilation
            error. Can any one help me on this?

            *Source code is as follows*

                // OK, let's evaluate the expression...

                XObjectPtr theResult( theEvaluator.evaluate( theDOMSupport,

                                    theContextNode,

XalanDOMString(expression.c_str()).c_str(),

                                    thePrefixResolver));

                XPathEvaluator::terminate();

                vector <char> charData;

                charData = theResult->str().transcode();

                returnVal.assign(charData.begin(), charData.end());

            *Following is the error.*

            Error 181: "XMResponseParser.cc", line 195 # Expected 1
            argument(s) for "void
            
xalanc_1_9::XalanDOMString::transcode(xalanc_1_9::XalanVector<char,xalanc_1_9::MemoryManagedConstructionTraits<char>
             > &) const"; had 0 instead.

                    charData = theResult->str().transcode();

                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When we implemented pluggable memory management, we had to make changes to functions that returned objects by value. So, instead of returning then by value, the functions expect the argument as the first parameter. Also, we moved from using the containers in the standard library to a set of custom containers.

Your code can be re-written as follows:


// OK, let's evaluate the expression...

    XObjectPtr theResult( theEvaluator.evaluate( theDOMSupport,

                                     theContextNode,


    XalanDOMString(expression.c_str()).c_str(),

                                     thePrefixResolver));

    XPathEvaluator::terminate();

    XalanVector<char> charData;

    theResult->str().transcode(charData);

    returnVal.assign(charData.begin(), charData.end());

Note that it's a very bad idea to XPathEvaluator::terminate() the way you're doing it. You should call XPathEvaluator::initialize() at the same place you XMLPlatformUtils::Initialize() and XalanTransformer::initialize(), and call XPathEvaluator::terminate() the same place you call the other terminate functions.

Dave

Reply via email to