Moddy Te'eni wrote:
Meanwhile, I had another idea. I don't manage to implement it without
crashing, though. Probably because I can't find any documentation.

I avoid using XPathEvaluator, but instead use XPath::execute. This is a code
snippet, which i inserted in the SimpleXPathApi sample code
If you follow the model of XPathEvaluator, you shouldn't have any problems.




                // Parse the document...
                XalanDocument* const    theDocument =
                                theLiaison.parseXMLStream(theInputSource);
                assert(theDocument != 0);

                XalanDocumentPrefixResolver             
thePrefixResolver(theDocument);

                XPathProcessorImpl theProcessor;
                XPathConstructionContextDefault theConstructionContext;


                XPathExecutionContextDefault theExecutionContext(
XalanMemMgrs::getDefault());

                XPath root(XalanMemMgrs::getDefault());
                theProcessor.initXPath(root, theConstructionContext,
XalanDOMString(argv[3]), thePrefixResolver);


                // OK, let's find the context node...
                const XObjectPtr&   theResult =
                        root.execute(theDocument, thePrefixResolver, 
theExecutionContext);



Later I will change XPathExecutionContextDefault to my own class, but
meanwhile this program crashes in execute(), and I can't see why.
Without a copy of your instance document and the actual arguments to your application, it's hard to say what my be going wrong.

Dave

Reply via email to