#include <XPathProcessor.h>
An XPathProcessor
represents factory to compile, load and execute the XPath query.
XPathProcessor::XPathProcessor |
( |
| ) |
|
Default constructor.
Creates a Saxon-HE XPath product
XPathProcessor::XPathProcessor |
( |
SaxonProcessor * |
proc, |
|
|
std::string |
cwd = "" |
|
) |
| |
const char * XPathProcessor::checkException |
( |
| ) |
|
Check for exception thrown.
- Returns
- cha*. Returns the exception message if thrown otherwise return NULL
void XPathProcessor::clearParameters |
( |
bool |
deleteValues = false | ) |
|
Clear parameter values set
- Parameters
-
deleteValues. | Individual pointers to XdmValue objects have to be deleted in the calling program Default behaviour (false) is to leave XdmValues in memory true then XdmValues are deleted |
void XPathProcessor::clearProperties |
( |
| ) |
|
Clear property values set
void XPathProcessor::declareNamespace |
( |
const char * |
prefix, |
|
|
const char * |
uri |
|
) |
| |
Declare a namespace binding as part of the static context for XPath expressions compiled using this XPathCompiler
- Parameters
-
prefix | The namespace prefix. If the value is a zero-length string, this method sets the default namespace for elements and types. |
uri | The namespace URI. It is possible to specify a zero-length string to "undeclare" a namespace; in this case the prefix will not be available for use, except in the case where the prefix is also a zero length string, in which case the absence of a prefix implies that the name is in no namespace. Assume the prefix or uri is null. |
bool XPathProcessor::effectiveBooleanValue |
( |
const char * |
xpathStr | ) |
|
Evaluate the XPath expression, returning the effective boolean value of the result.
- Parameters
-
xpathStr | - supplied as a character string |
- Returns
- bool
XdmValue * XPathProcessor::evaluate |
( |
const char * |
xpathStr | ) |
|
Compile and evaluate an XPath expression.
- Parameters
-
xpathStr | - supplied as a character string |
- Returns
- XdmValue
XdmItem * XPathProcessor::evaluateSingle |
( |
const char * |
xpathStr | ) |
|
Compile and evaluate an XPath expression. The result is expected to be a single XdmItem.
- Parameters
-
xpathStr | - supplied as a character string |
- Returns
- XdmItem
int XPathProcessor::exceptionCount |
( |
| ) |
|
Get number of errors reported during evaluation of the XPath.
After the evalution of the XPAth expression there may be a number of errors reported against it.
- Returns
- int - Count of the exceptions recorded against the transformation
bool XPathProcessor::exceptionOccurred |
( |
| ) |
|
Checks for pending exceptions without creating a local reference to the exception object
- Returns
- bool - true when there is a pending exception; otherwise return false Checks for pending exceptions without creating a local reference to the exception object
-
bool - true when there is a pending exception; otherwise return false
const char * XPathProcessor::getErrorCode |
( |
int |
i | ) |
|
Get the ith error code if there are any error.
After the execution of the XPath expression there may be a number of errors reported against it.
- Returns
- char* - The error code of the i'th exception.
const char * XPathProcessor::getErrorMessage |
( |
int |
i | ) |
|
Get the ith error message if there are any error.
A transformation may have a number of errors reported against it.
- Returns
- char* - The message of the i'th exception
std::map< std::string, XdmValue * > & XPathProcessor::getParameters |
( |
| ) |
|
Get all parameters as a std::map
std::map< std::string, std::string > & XPathProcessor::getProperties |
( |
| ) |
|
Get all properties as a std::map
bool XPathProcessor::removeParameter |
( |
const char * |
name | ) |
|
Remove a parameter (name, value) pair
- Parameters
-
- Returns
- bool - outcome of the romoval
void XPathProcessor::setBaseURI |
( |
const char * |
uriStr | ) |
|
Set the static base URI for XPath expressions compiled using this XPathCompiler.
The base URI is part of the static context, and is used to resolve any relative URIs appearing within an XPath expression, for example a relative URI passed as an argument to the doc() function. If no static base URI is supplied, then the current working directory is used.
- Parameters
-
void XPathProcessor::setcwd |
( |
const char * |
cwd | ) |
|
set the current working directory
void XPathProcessor::setParameter |
( |
const char * |
name, |
|
|
XdmValue * |
value |
|
) |
| |
Set a parameter value used in the query s
- Parameters
-
name | of the parameter, as a string. For namespaced parameter use the JAXP solution i.e. "{uri}name" |
value | of the query parameter, or null to clear a previously set value |
void XPathProcessor::setProperty |
( |
const char * |
name, |
|
|
const char * |
value |
|
) |
| |
Set a property specific to the processor in use. XPathProcessor: set serialization properties (names start with '!' i.e. name "!method" -> "xml") 'o':outfile name, 's': context item supplied as file name
- Parameters
-
name | of the property |
value | of the property |
The documentation for this class was generated from the following files: