SaxonC 12.7.0
Saxon Processor library for C/C++, PHP and Python
Loading...
Searching...
No Matches
Classes | Functions
SaxonCProcessor.h File Reference

SaxonCProcessor.h provides the C API for XSLT and XQuery processing. This file contains a set of functions to compile and execute stylesheets and queries. More...

#include "saxonc_export.h"
#include "saxonc/SaxonCGlue.h"

Go to the source code of this file.

Classes

struct  sxnc_xquery
 sxnc_xquery. More...
 
struct  sxnc_xslt
 sxnc_xslt. More...
 
struct  sxnc_xpath
 sxnc_xpath. More...
 

Functions

EXTERN_SAXONC SAXONC_EXPORT const char * version (sxnc_environment *environi, sxnc_processor *proc)
 Get the Saxon version.
 
SAXONC_EXPORT const char * getProductVariantAndVersion (sxnc_environment *environi, sxnc_processor *proc)
 Get the Saxon version and edition.
 
SAXONC_EXPORT void initSaxonc (sxnc_environment **environi, sxnc_processor **proc, sxnc_parameter **param, sxnc_property **prop, int cap, int propCap)
 Initialise the SaxonC Processor, along with the parameters and the properties pointers.
 
SAXONC_EXPORT void freeSaxonc (sxnc_environment **environi, sxnc_processor **proc, sxnc_parameter **param, sxnc_property **prop)
 Free associated memory on the heap created by the SaxonC Processors, properties and parameters.
 
SAXONC_EXPORT void setConfigurationProperty (sxnc_environment *environi, sxnc_processor *proc, char *name, char *value)
 Set a configuration property specific to the processor in use.
 
SAXONC_EXPORT void setCatalog (sxnc_environment *environi, sxnc_processor *proc, char *cwd, char *catalogFileName)
 Set a catalog file to be used in Saxon.
 
SAXONC_EXPORT void setCatalogFiles (sxnc_environment *environi, sxnc_processor *proc, char *cwd, char **catalogFileName, int length)
 Set multiple catalog files to be used in Saxon.
 
SAXONC_EXPORT void xsltSaveResultToFile (sxnc_environment *environi, sxnc_processor *proc, char *cwd, char *source, char *stylesheet, char *outputfile, sxnc_parameter *parameters, sxnc_property *properties, int parLen, int propLen)
 Transform an XSLT stylesheet with the result saved to file.
 
SAXONC_EXPORT const char * xsltApplyStylesheet (sxnc_environment *environi, sxnc_processor *proc, char *cwd, char *source, char *stylesheet, sxnc_parameter *parameters, sxnc_property *properties, int parLen, int propLen)
 Transform an XSLT stylesheet with the result returned as a string value (char pointer array).
 
SAXONC_EXPORT void executeQueryToFile (sxnc_environment *environi, sxnc_processor *proc, char *cwd, char *outputfile, sxnc_parameter *parameters, sxnc_property *properties, int parLen, int propLen)
 Execute a query with the result saved to file.
 
SAXONC_EXPORT const char * executeQueryToString (sxnc_environment *environi, sxnc_processor *proc, char *cwd, sxnc_parameter *parameters, sxnc_property *properties, int parLen, int propLen)
 Execute a query with the result returned as a string value (char pointer array).
 
SAXONC_EXPORT const char * c_getErrorMessage (sxnc_environment *environi)
 Get a pointer to the current error message as a string.
 

Detailed Description

SaxonCProcessor.h provides the C API for XSLT and XQuery processing. This file contains a set of functions to compile and execute stylesheets and queries.

Function Documentation

◆ c_getErrorMessage()

SAXONC_EXPORT const char * c_getErrorMessage ( sxnc_environment * environi)

Get a pointer to the current error message as a string.

Parameters
environi- GraalVM environment

◆ executeQueryToFile()

SAXONC_EXPORT void executeQueryToFile ( sxnc_environment * environi,
sxnc_processor * proc,
char * cwd,
char * outputfile,
sxnc_parameter * parameters,
sxnc_property * properties,
int parLen,
int propLen )

Execute a query with the result saved to file.

Parameters
environi- GraalVM environment
proc- Pointer to the Saxon Processor used for creating the XQuery executable
cwd- Current working directory - used for base URI for input and output files
outputfile- The file name of where the result will be stored
parameters- Array of parameters for the query, as mappings (string, value)
properties- Array of properties for the query, as mappings (string, string). Available XQuery Processor properties: serialization properties names start with '!' (e.g. '!method' -> 'xml'), 'o': output file name, 's': source file name, 'q': query file name, 'qs': string form of the query, 'base': base URI of the query, 'dtd': set DTD validation 'on' or 'off'
parLen- The length of the parameters array
propLen- The length of the properties array

◆ executeQueryToString()

SAXONC_EXPORT const char * executeQueryToString ( sxnc_environment * environi,
sxnc_processor * proc,
char * cwd,
sxnc_parameter * parameters,
sxnc_property * properties,
int parLen,
int propLen )

Execute a query with the result returned as a string value (char pointer array).

Parameters
environi- GraalVM environment
proc- Pointer to the Saxon Processor used for creating the XQuery executable
cwd- Current working directory - used for base URI for input and output files
parameters- Array of parameters for the query, as mappings (string, value)
properties- Array of properties for the query, as mappings (string, string). Available XQuery Processor properties: serialization properties names start with '!' (e.g. '!method' -> 'xml'), 'o': output file name, 's': source file name, 'q': query file name, 'qs': string form of the query, 'base': base URI of the query, 'dtd': set DTD validation 'on' or 'off'
parLen- The length of the parameters array
propLen- The length of the properties array

◆ freeSaxonc()

SAXONC_EXPORT void freeSaxonc ( sxnc_environment ** environi,
sxnc_processor ** proc,
sxnc_parameter ** param,
sxnc_property ** prop )

Free associated memory on the heap created by the SaxonC Processors, properties and parameters.

Parameters
environi- GraalVM environment held as the struct sxnc_environment
proc- Pointer to the Saxon Processor which is represented as the struct sxnc_processor
param- Pointers to the sxnc_parameter structs used for parameters
prop- Pointers to the sxnc_property structs used for properties

◆ initSaxonc()

SAXONC_EXPORT void initSaxonc ( sxnc_environment ** environi,
sxnc_processor ** proc,
sxnc_parameter ** param,
sxnc_property ** prop,
int cap,
int propCap )

Initialise the SaxonC Processor, along with the parameters and the properties pointers.

This utility function is used to allocate memory on the heap, therefore is required to be called before execution of stylesheets or queries.

Parameters
environi- GraalVM environment held as the struct sxnc_environment. This function calls malloc on the pointer.
proc- Pointer to the Saxon Processor which is represented as the struct sxnc_processor and is used for creating the XSLT and XQuery processors. This function calls malloc on the pointer.
param- Pointers to the sxnc_parameter structs used for parameters. This function calls calloc on the pointers.
prop- Pointers to the sxnc_property structs used for properties. This function calls calloc on the pointers.
cap- The length of the parameters array
propCap- The length of the properties array

◆ setCatalog()

SAXONC_EXPORT void setCatalog ( sxnc_environment * environi,
sxnc_processor * proc,
char * cwd,
char * catalogFileName )

Set a catalog file to be used in Saxon.

Parameters
environi- GraalVM environment
proc- Pointer to the Saxon Processor which is represented as the struct sxnc_processor
cwd- Current working directory
catalogFileName- file name to the catalog
Deprecated

◆ setCatalogFiles()

SAXONC_EXPORT void setCatalogFiles ( sxnc_environment * environi,
sxnc_processor * proc,
char * cwd,
char ** catalogFileName,
int length )

Set multiple catalog files to be used in Saxon.

Parameters
environi- GraalVM environment
proc- Pointer to the Saxon Processor which is represented as the struct sxnc_processor
cwd- Current working directory
catalogFileNames- file names to the catalog as an array of pointers
length- Number of cataFileNames to be added

◆ setConfigurationProperty()

SAXONC_EXPORT void setConfigurationProperty ( sxnc_environment * environi,
sxnc_processor * proc,
char * name,
char * value )

Set a configuration property specific to the processor in use.

Parameters
environi- GraalVM environment
proc- Pointer to the Saxon Processor which is represented as the struct sxnc_processor
name- the name of the property
value- the value for the property

◆ xsltApplyStylesheet()

SAXONC_EXPORT const char * xsltApplyStylesheet ( sxnc_environment * environi,
sxnc_processor * proc,
char * cwd,
char * source,
char * stylesheet,
sxnc_parameter * parameters,
sxnc_property * properties,
int parLen,
int propLen )

Transform an XSLT stylesheet with the result returned as a string value (char pointer array).

The compile and execution is done in the same call of this method.

Parameters
environi- GraalVM environment
proc- Pointer to the Saxon Processor used for creating the XSLT executable
cwd- Current working directory - used for base URI for input and output files
source- The file name of the source document
stylesheet- The file name of the stylesheet document
parameters- Array of parameters for the transform, as mappings (string, value)
properties- Array of properties for the transform, as mappings (string, string). Available XSLT Processor properties: serialization properties names start with '!' (e.g. '!method' -> 'xml'), 'o': output file name, 'it': initial template, 'im': initial mode, 's': source file name, 'm': switch on message listener for xsl:message instructions
parLen- The length of the parameters array
propLen- The length of the properties array
Returns
char pointer array - The result of the transformation

◆ xsltSaveResultToFile()

SAXONC_EXPORT void xsltSaveResultToFile ( sxnc_environment * environi,
sxnc_processor * proc,
char * cwd,
char * source,
char * stylesheet,
char * outputfile,
sxnc_parameter * parameters,
sxnc_property * properties,
int parLen,
int propLen )

Transform an XSLT stylesheet with the result saved to file.

The compile and execution is done in the same call of this method.

Parameters
environi- GraalVM environment
proc- Pointer to the Saxon Processor used for creating the XSLT executable
cwd- Current working directory - used for base URI for input and output files
source- The file name of the source document
stylesheet- The file name of the stylesheet document
outputfile- The file name of where the result will be stored
parameters- Array of parameters for the transform, as mappings (string, value)
properties- Array of properties for the transform, as mappings (string, string). Available XSLT Processor properties: serialization properties names start with '!' (e.g. '!method' -> 'xml'), 'o': output file name, 'it': initial template, 'im': initial mode, 's': source file name, 'm': switch on message listener for xsl:message instructions
parLen- The length of the parameters array
propLen- The length of the properties array