![]() |
SaxonC 12.7.0
Saxon Processor library for C/C++, PHP and Python
|
SaxonCXPath.h
provides the C API for XPath processing. This file contains a set of functions to compile and execute XPath expressions.
More...
Go to the source code of this file.
Functions | |
SAXONC_EXPORT int64_t | booleanValue (sxnc_environment *environi, bool val) |
Create a boxed Boolean value. | |
SAXONC_EXPORT int64_t | integerValue (sxnc_environment *environi, int i) |
Create a boxed Integer value. | |
SAXONC_EXPORT int64_t | doubleValue (sxnc_environment *environi, double d) |
Create a boxed Double value. | |
SAXONC_EXPORT int64_t | floatValue (sxnc_environment *environi, float f) |
Create a boxed Float value. | |
SAXONC_EXPORT int64_t | longValue (sxnc_environment *environi, long l) |
Create a boxed Long value. | |
SAXONC_EXPORT int64_t | getJavaStringValue (sxnc_environment *environi, const char *str) |
Create a boxed String value. | |
SAXONC_EXPORT int64_t | xdmValueAsObj (sxnc_environment *environi, const char *type, const char *str) |
A Constructor for internal use. | |
SAXONC_EXPORT sxnc_value * | xdmValue (sxnc_environment *environi, const char *type, const char *str) |
A Constructor. | |
SAXONC_EXPORT int | c_createXPathProcessor (sxnc_environment *environi, sxnc_processor *processor, sxnc_xpath *xpath) |
Initialise the Saxon Processor and XPath processor. | |
SAXONC_EXPORT sxnc_value * | evaluate (sxnc_environment *environi, sxnc_xpath *proc, char *cwd, char *xpathStr, char *encoding, sxnc_parameter *parameters, sxnc_property *properties, int parLen, int propLen) |
Compile and evaluate an XPath expression, supplied as a character string, with properties and parameters required by the XPath expression. | |
SAXONC_EXPORT sxnc_value * | evaluateSingle (sxnc_environment *environi, sxnc_xpath *proc, char *cwd, char *xpathStr, char *encoding, sxnc_parameter *parameters, sxnc_property *properties, int parLen, int propLen) |
Compile and evaluate an XPath expression for which the result is expected to be a single XdmItem or NULL. | |
SAXONC_EXPORT bool | effectiveBooleanValue (sxnc_environment *environi, sxnc_xpath *proc, char *cwd, char *xpathStr, char *encoding, sxnc_parameter *parameters, sxnc_property *properties, int parLen, int propLen) |
Evaluate an XPath expression, returning the effective boolean value of the result. | |
SAXONC_EXPORT bool | isAtomicValue (sxnc_environment *environi, sxnc_value value) |
Determine whether the item is an atomic value or a node. | |
SAXONC_EXPORT int | size (sxnc_environment *environi, sxnc_value val) |
Get the number of items in the sequence. | |
SAXONC_EXPORT const char * | getStringValue (sxnc_environment *environi, sxnc_value value) |
Get the string value of the item. | |
SAXONC_EXPORT int | getIntegerValue (sxnc_environment *environi, sxnc_value value, int failure_value) |
Get the integer value of the item. | |
SAXONC_EXPORT bool | getBooleanValue (sxnc_environment *environi, sxnc_value value) |
Get the boolean value of the item. | |
SAXONC_EXPORT long | getLongValue (sxnc_environment *environi, sxnc_value value, long failureVal) |
Get the long value of the item. | |
SAXONC_EXPORT float | getFloatValue (sxnc_environment *environi, sxnc_value value, float failureVal) |
Get the float value of the item. | |
SAXONC_EXPORT double | getDoubleValue (sxnc_environment *environi, sxnc_value value, double failureVal) |
Get the double value of the item. | |
SaxonCXPath.h
provides the C API for XPath processing. This file contains a set of functions to compile and execute XPath expressions.
SAXONC_EXPORT int64_t booleanValue | ( | sxnc_environment * | environi, |
bool | val ) |
Create a boxed Boolean value.
environi | - GraalVM environment held as the struct sxnc_environment. |
val | - boolean value |
SAXONC_EXPORT int c_createXPathProcessor | ( | sxnc_environment * | environi, |
sxnc_processor * | processor, | ||
sxnc_xpath * | xpath ) |
Initialise the Saxon Processor and XPath processor.
This utility function is used to allocate memory on the heap, therefore is required to be called before execution of XPath.
environi | - GraalVM environment held as the struct sxnc_environment. This function calls malloc on the pointer. |
processor | - Pointer to the Saxon Processor which is represented as the struct sxnc_processor and is used for creating the XPath processor. This function calls malloc on the pointer. |
xpath | - Pointer to the sxnc_xpath struct which is used for the execution of XPath expressions. This function calls malloc on the pointer |
SAXONC_EXPORT int64_t doubleValue | ( | sxnc_environment * | environi, |
double | d ) |
Create a boxed Double value.
environi | - GraalVM environment held as the struct sxnc_environment. |
d | - double value |
SAXONC_EXPORT bool effectiveBooleanValue | ( | sxnc_environment * | environi, |
sxnc_xpath * | proc, | ||
char * | cwd, | ||
char * | xpathStr, | ||
char * | encoding, | ||
sxnc_parameter * | parameters, | ||
sxnc_property * | properties, | ||
int | parLen, | ||
int | propLen ) |
Evaluate an XPath expression, returning the effective boolean value of the result.
environi | - GraalVM environment |
proc | - Pointer to the XPath Processor used for creating the XPath executable |
cwd | - Current working directory |
xpathStr | - A string containing the source text of the XPath expression |
encoding | - the encoding of the string. Accept null. If not specified then the platform default encoding is used. |
parameters | - Array of parameters for the XPath expression, as mappings (string, value) |
properties | - Array of properties for the XPath expression, as mappings (string, string). This could contain the context node, source as string or file name, etc. |
parLen | - The length of the parameters array |
propLen | - The length of the properties array |
SAXONC_EXPORT sxnc_value * evaluate | ( | sxnc_environment * | environi, |
sxnc_xpath * | proc, | ||
char * | cwd, | ||
char * | xpathStr, | ||
char * | encoding, | ||
sxnc_parameter * | parameters, | ||
sxnc_property * | properties, | ||
int | parLen, | ||
int | propLen ) |
Compile and evaluate an XPath expression, supplied as a character string, with properties and parameters required by the XPath expression.
environi | - GraalVM environment |
proc | - Pointer to the XPath Processor used for creating the XPath executable |
cwd | - Current working directory |
xpathStr | - A string containing the source text of the XPath expression |
encoding | - the encoding of the string. Accept null. If not specified then the platform default encoding is used. |
parameters | - Array of parameters for the XPath expression, as mappings (string, value) |
properties | - Array of properties for the XPath expression, as mappings (string, string). This could contain the context node, source as string or file name, etc. |
parLen | - The length of the parameters array |
propLen | - The length of the properties array |
SAXONC_EXPORT sxnc_value * evaluateSingle | ( | sxnc_environment * | environi, |
sxnc_xpath * | proc, | ||
char * | cwd, | ||
char * | xpathStr, | ||
char * | encoding, | ||
sxnc_parameter * | parameters, | ||
sxnc_property * | properties, | ||
int | parLen, | ||
int | propLen ) |
Compile and evaluate an XPath expression for which the result is expected to be a single XdmItem or NULL.
The XPath expression is supplied as a character string, with properties and parameters required by the XPath expression.
environi | - GraalVM environment |
proc | - Pointer to the XPath Processor used for creating the XPath executable |
cwd | - Current working directory |
xpathStr | - A string containing the source text of the XPath expression |
encoding | - the encoding of the string. Accept null. If not specified then the platform default encoding is used. |
parameters | - Array of parameters for the XPath expression, as mappings (string, value) |
properties | - Array of properties for the XPath expression, as mappings (string, string). This could contain the context node, source as string or file name, etc. |
parLen | - The length of the parameters array |
propLen | - The length of the properties array |
SAXONC_EXPORT int64_t floatValue | ( | sxnc_environment * | environi, |
float | f ) |
Create a boxed Float value.
environi | - GraalVM environment held as the struct sxnc_environment. |
f | - float value |
SAXONC_EXPORT bool getBooleanValue | ( | sxnc_environment * | environi, |
sxnc_value | value ) |
Get the boolean value of the item.
environi | - GraalVM environment held as the struct sxnc_environment. |
value | - Value to convert to boolean |
SAXONC_EXPORT double getDoubleValue | ( | sxnc_environment * | environi, |
sxnc_value | value, | ||
double | failureVal ) |
Get the double value of the item.
environi | - GraalVM environment held as the struct sxnc_environment. |
value | - Value to convert to double |
failureVal | - If the Value is not a double then we can specify the value to return. Default is zero. |
SAXONC_EXPORT float getFloatValue | ( | sxnc_environment * | environi, |
sxnc_value | value, | ||
float | failureVal ) |
Get the float value of the item.
environi | - GraalVM environment held as the struct sxnc_environment. |
value | - Value to convert to float |
failureVal | - If the Value is not a float then we can specify the value to return. Default is zero. |
SAXONC_EXPORT int getIntegerValue | ( | sxnc_environment * | environi, |
sxnc_value | value, | ||
int | failure_value ) |
Get the integer value of the item.
environi | - GraalVM environment held as the struct sxnc_environment. |
value | - Value to convert to integer |
failure_value | - If the value is not an integer then we can specify the value to return. Default is zero. |
SAXONC_EXPORT int64_t getJavaStringValue | ( | sxnc_environment * | environi, |
const char * | str ) |
Create a boxed String value.
environi | - GraalVM environment held as the struct sxnc_environment. |
str | - char array value |
SAXONC_EXPORT long getLongValue | ( | sxnc_environment * | environi, |
sxnc_value | value, | ||
long | failureVal ) |
Get the long value of the item.
environi | - GraalVM environment held as the struct sxnc_environment. |
value | - Value to convert to long |
failureVal | - If the Value is not a long then we can specify the value to return. Default is zero. |
SAXONC_EXPORT const char * getStringValue | ( | sxnc_environment * | environi, |
sxnc_value | value ) |
Get the string value of the item.
For a node, this gets the string value of the node. For an atomic value, it has the same effect as casting the value to a string. In all cases the result is the same as applying the XPath string() function.
environi | - GraalVM environment held as the struct sxnc_environment. |
value | - Value to convert to string |
SAXONC_EXPORT int64_t integerValue | ( | sxnc_environment * | environi, |
int | i ) |
Create a boxed Integer value.
environi | - GraalVM environment held as the struct sxnc_environment. |
i | - int value |
SAXONC_EXPORT bool isAtomicValue | ( | sxnc_environment * | environi, |
sxnc_value | value ) |
Determine whether the item is an atomic value or a node.
environi | - GraalVM environment held as the struct sxnc_environment. |
value | - XDM value |
SAXONC_EXPORT int64_t longValue | ( | sxnc_environment * | environi, |
long | l ) |
Create a boxed Long value.
environi | - GraalVM environment held as the struct sxnc_environment. |
l | - long value |
SAXONC_EXPORT int size | ( | sxnc_environment * | environi, |
sxnc_value | val ) |
Get the number of items in the sequence.
environi | - GraalVM environment held as the struct sxnc_environment. |
val | - XDM value |
SAXONC_EXPORT sxnc_value * xdmValue | ( | sxnc_environment * | environi, |
const char * | type, | ||
const char * | str ) |
A Constructor.
Create an XdmValue based on the target type. Conversion is applied if possible.
environi | - GraalVM environment held as the struct sxnc_environment. |
type | - the target type of the value |
str | - value to convert |
SAXONC_EXPORT int64_t xdmValueAsObj | ( | sxnc_environment * | environi, |
const char * | type, | ||
const char * | str ) |
A Constructor for internal use.
Create an underlying representation for the XdmValue based on the target type. Conversion is applied if possible.
environi | - GraalVM environment held as the struct sxnc_environment. |
type | - the target type of the value |
str | - value to convert |