xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Bogouchev <ivan.bogouc...@gmail.com>
Subject Re: Evaluating Xpath in Xerces
Date Mon, 11 Jul 2005 08:36:47 GMT
Hi Jose,

I hope I am wrong and somebody will correct me, but after about two weeks 
spent playing with pathan, now I think that you'd better not use the current 
distribution (2.0beta here).
In fact there are several (still not fixed) memory leaks and it doesn't seem 
that there is anybody working on fixing them. There is no activity on the 
pathan mailing list.

On 7/8/05, Jose Ignacio MarĂ­n Alberdi <jimarin@telefonica.net> wrote:
> Gareth,
> Could you provide with a minimalistic example taken from Pathan ?

I have been diving into Pathan source code but cannot see where the

> DOMXpathEvaluator class is used.

Ok however if you are not parsing too many documents and you can live with 
leaks in your code, it is DOMDocument that implements the DOMXpathEvaluator 
interface. Your implementation must support the "XPath2 3.0" feature, e.g. 
you obtain it via the following code:

DOMImplementation* pathanImplementation = 
DOMImplementationRegistry::getDOMImplementation(X("XPath2 3.0"));

and you must link your code either statically or dynamicaly with pathan.

Then you can get an NSResolver and an DOMXPathExpression like this:

DOMXPathNSResolver* resolver = 
const DOMXPathExpression *expr = document->createExpression( X("THE XPATH 
EXPRESSION"), resolver);

Hope this helps

View raw message