I am trying to determine whether a certain value actually appears in the xml file or not. However, there seems to be no way of telling. If I request an invalid or non-existant XPath I get an empty string and no nodes in the node set as return. If I request a valid XPath expression which correctly evaluates to an empty string I get exactly the same result. The processor's state variable indicates e_error_no in both cases.

So, how can I tell the difference between an error state and an empty string return?

My best guess was the following:

TinyXPath::xpath_processor processor( m_Document->RootElement(), key.c_str());
if ( processor.u_compute_xpath_node_set())
    m_CachedResults[key] = processor.S_compute_xpath().c_str();
else
    m_CachedResults[key] = defaultValue;

Doesn't help to differentiate between the following however:
<test></test>

expression "/test/@text()" returns e_error_no, no nodes and an empty string.
expression "/an/invalid/path" returns e_error_no, no nodes and an empty string.

what am I to do?

    Sören