[xml] handling xpath error - libxml

I would like to how to handle the xpath error gracefully when I use the libxml api,
xmlXPathEvalExpression(path, xpathCtx).
If I pass a invalid path string to evaluate on the "xpathCtx", it throws the error as below and stops there.
But I would like to handle that error gracefully and log it accordingly and proceed with my application.
So, could anyone give me ideas on doing the same? Or is it possible to check the xpath expr is valid or not even before
calling the libxml api.
Error and stops immd:
XPath error : Invalid _expression_
/roottag///*[ check='1']

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]