Hi all.

I have a bit of simple code using xalan to get a certain node value, but
in the case the node does not exsist I expect it to throw an exception,
which doesn't happen.
This is a segment of the code:


....
try
        {
                // OK, let's find the context node...
                XalanNode* const        theContextNode =
                        theEvaluator.selectSingleNode(
                        theDOMSupport,
                        &docWrapper,
                        XalanDOMString(szContext).c_str(), prefixResolver
                        );

                if (theContextNode)
                {
                        // OK, let's evaluate the expression...
                        const XObjectPtr        theResult(
                                theEvaluator.evaluate(
                                theDOMSupport,
                                theContextNode,
                                XalanDOMString(xpathXpr).c_str(),
                                prefixResolver
                                ));
                        if(!theResult.null()){
                             return theResult;
                        }
                }
        }
        catch(...)
        {
          // doesn't get here...
        }

...

When I use ->str on the result object I get an empty string.
How can I know the path does not exist?

Thanks alot.
Alice.

Reply via email to