SaxonC 12.5
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 "SaxonCGlue.h"

Go to the source code of this file.

Classes

struct  sxnc_xquery
 
struct  sxnc_xslt
 
struct  sxnc_xpath
 

Functions

EXTERN_SAXONC const char * version (sxnc_environment *environi, sxnc_processor *proc)
 
const char * getProductVariantAndVersion (sxnc_environment *environi, sxnc_processor *proc)
 
void initSaxonc (sxnc_environment **environi, sxnc_processor **proc, sxnc_parameter **param, sxnc_property **prop, int cap, int propCap)
 
void freeSaxonc (sxnc_environment **environi, sxnc_processor **proc, sxnc_parameter **param, sxnc_property **prop)
 
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)
 
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)
 
void executeQueryToFile (sxnc_environment *environi, sxnc_processor *proc, char *cwd, char *outputfile, sxnc_parameter *parameters, sxnc_property *properties, int parLen, int propLen)
 
const char * executeQueryToString (sxnc_environment *environi, sxnc_processor *proc, char *cwd, sxnc_parameter *parameters, sxnc_property *properties, int parLen, int propLen)
 
const char * c_getErrorMessage (sxnc_environment *environi)
 

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()

const char * c_getErrorMessage ( sxnc_environment * environi)

Get a pointer to the current error message as a string

Parameters
environi- GraalVM environment

◆ executeQueryToFile()

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()

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()

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

◆ getProductVariantAndVersion()

const char * getProductVariantAndVersion ( sxnc_environment * environi,
sxnc_processor * proc )

Get the Saxon version and edition

◆ initSaxonc()

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

◆ version()

EXTERN_SAXONC const char * version ( sxnc_environment * environi,
sxnc_processor * proc )

Get the Saxon version

◆ xsltApplyStylesheet()

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()

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