XmlQueryContext::setReturnType |
![]() ![]() |
#include <DbXml.hpp>void XmlQueryContext::setReturnType(ReturnType type);
The XmlQueryContext::setReturnType method sets the query return type. The query can return candidate documents, result documents, or result values. A candidate document is a document that may match the XPath expression, a result document is a document that does match the XPath expression, and a result value is the result of executing the XPath expression against the result document.
For some expressions it might be known that the candidate set is in fact equivalent to the result set. For these expressions there is no need to pass the candidate documents through a filter to eliminate false positives. The query processor can detect some expressions of this nature, but not all. The user application may know better, or may want to do its own false positive elimination.
The type must be set to one of the following values:
The XmlQueryContext::setReturnType method throws an exception that encapsulates a non-zero error value on failure.
The XmlQueryContext::setReturnType method may fail and throw an exception encapsulating a non-zero error for the following conditions:
The XmlQueryContext::setReturnType method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods. If a catastrophic error has occurred, the XmlQueryContext::setReturnType method may fail and throw a DbRunRecoveryException, in which case all subsequent Berkeley DB calls will fail in the same way.
XmlDocument::getAttributeValue, XmlDocument::getContent, XmlDocument::getID, XmlDocument::getName, XmlDocument::getType, XmlDocument::setContent, XmlDocument::setName, and XmlDocument::setType.
![]() ![]() |