10#ifndef SAXON_PROCESSOR_H
11#define SAXON_PROCESSOR_H
13#if defined __linux__ || defined __APPLE__
20#define LoadLibrary(x) dlopen(x, RTLD_LAZY)
21#define GetProcAddress(x, y) dlsym(x, y)
28#define CVERSION "12.5.0"
29#define CVERSION_API_NO 1210
38#include "DocumentBuilder.h"
39#include "SaxonApiException.h"
42#include "SchemaValidator.h"
43#include "XPathProcessor.h"
44#include "XQueryProcessor.h"
45#include "Xslt30Processor.h"
46#include "XsltExecutable.h"
56static std::vector<void *> myAlloc;
58void *newImpl(std::size_t sz,
char const *file,
int line);
60void *
operator new(std::size_t sz,
char const *file,
int line);
62void *
operator new[](std::size_t sz,
char const *file,
int line);
64void operator delete(
void *ptr)
noexcept;
66void operator delete(
void *, std::size_t)
noexcept;
98typedef enum eXdmType {
100 XDM_ATOMIC_VALUE = 1,
104 XDM_FUNCTION_ITEM = 5,
246 const char *encoding =
nullptr);
260 const char *encoding =
nullptr);
396 XdmMap *
makeMap(std::map<XdmAtomicValue *, XdmValue *> dataMap);
406 static XdmMap *
makeMap2(std::map<std::string, XdmValue *> dataMap);
463 const char *encoding =
nullptr,
503 const char *encoding = NULL);
737 if (data !=
nullptr && deleteFlag == 0) {
738 operator delete((
char *)data);
762 std::map<std::string, XdmValue *>
765 std::map<std::string, std::string>
783 void initialize(
bool l);
785 void applyConfigurationProperties();
789 createParameterJArray(std::map<std::string, XdmValue *>
parameters,
790 std::map<std::string, std::string> properties,
794 createParameterJArray2(std::map<std::string, XdmValue *>
parameters);
796 static int64_t createJArray(
XdmValue **values,
int length);
798 static XdmValue *makeXdmValueFromRef(int64_t valueRef);
800 static XdmItem *makeXdmItemFromRef(int64_t valueRef);
802 static const char *checkException();
This C header file contains a number of factory functions for running SaxonC C/C++ APIs,...
SaxonCXPath.h provides the C API for XPath processing. This file contains a set of functions to compi...
Definition DocumentBuilder.h:35
Definition SaxonApiException.h:23
Definition SaxonProcessor.h:117
void setcwd(const char *cwd)
Set the current working directory.
Definition SaxonProcessor.cpp:701
XdmAtomicValue * makeStringValue(std::string str, const char *encoding=nullptr)
Definition SaxonProcessor.cpp:956
const char * getResourcesDirectory()
Get saxon resources directory.
Definition SaxonProcessor.cpp:709
void setCatalog(const char *catalogFile)
Definition SaxonProcessor.cpp:724
XdmNode * parseXmlFromFile(const char *source, SchemaValidator *validator=nullptr)
Parse a source document file and return it as an XdmNode.
Definition SaxonProcessor.cpp:853
XdmMap * makeMap3(XdmAtomicValue **keys, XdmValue **values, int len)
Make an XdmMap from an array of keys and values.
Definition SaxonProcessor.cpp:1254
static void detachCurrentThread()
Detach JVM from the current thread.
Definition SaxonProcessor.cpp:283
std::string cwdV
Definition SaxonProcessor.h:759
static void release()
Definition SaxonProcessor.cpp:910
XdmAtomicValue * makeAtomicValue(const char *type, const char *value)
Create an Xdm Atomic value from string representation.
Definition SaxonProcessor.cpp:1017
XdmNode * parseXmlFromUri(const char *source, SchemaValidator *validator=nullptr)
Parse a source document available by URI and return it as an XdmNode.
Definition SaxonProcessor.cpp:872
const char * getErrorMessage()
Get any error message thrown by the processor.
Definition SaxonProcessor.cpp:104
XdmValue * parseJsonFromString(const char *source, const char *encoding=NULL)
Definition SaxonProcessor.cpp:786
void setResourcesDirectory(const char *dir)
set saxon resources directory
Definition SaxonProcessor.cpp:713
static sxnc_environment * sxn_environ
Definition SaxonProcessor.h:726
static XdmMap * makeMap2(std::map< std::string, XdmValue * > dataMap)
Make an XdmMap whose argument is a map from the standard template library.
Definition SaxonProcessor.cpp:1215
void clearConfigurationProperties()
Clear configuration properties specific to the processor in use.
Definition SaxonProcessor.cpp:902
void exceptionClear()
Definition SaxonProcessor.cpp:111
XdmAtomicValue * makeBooleanValue(bool b)
Factory method: makes a XdmAtomicValue representing a boolean Value.
Definition SaxonProcessor.cpp:1002
SaxonProcessor()
A default constructor.
Definition SaxonProcessor.cpp:232
const char * getStringValue(XdmItem *item)
Get the string representation of the XdmValue.
Definition SaxonProcessor.cpp:1042
std::map< std::string, XdmValue * > parameters
Definition SaxonProcessor.h:763
XdmAtomicValue * makeQNameValue(const char *str)
Create an QName Xdm value from string representation in clark notation.
Definition SaxonProcessor.cpp:1010
SchemaValidator * newSchemaValidator()
Definition SaxonProcessor.cpp:681
const char * getcwd()
Get the current working directory.
Definition SaxonProcessor.cpp:707
const char * clarkNameToEQName(const char *name)
Convert clark name string to EQName notation.
Definition SaxonProcessor.cpp:1028
XdmAtomicValue * makeDoubleValue(double d)
Factory method. make an XdmAtomicValue from a primitive double value.
Definition SaxonProcessor.cpp:976
XdmAtomicValue * makeIntegerValue(int i)
Definition SaxonProcessor.cpp:966
XdmValue * parseJsonFromFile(const char *source)
Parse a source JSON file and return it as an XdmValue.
Definition SaxonProcessor.cpp:806
bool exceptionOccurred()
Checks for thrown exceptions.
Definition SaxonProcessor.cpp:81
const char * EQNameToClarkName(const char *name)
Convert EQName string to clark name notation.
Definition SaxonProcessor.cpp:1035
static SaxonApiException * checkForExceptionCPP()
Definition SaxonProcessor.cpp:125
void createHeapDump(bool live)
Internal method for diagnostics.
Definition SaxonProcessor.cpp:906
void setConfigurationProperty(const char *name, const char *value)
Set a configuration property specific to the processor in use.
Definition SaxonProcessor.cpp:894
void deleteXdmValueArray(XdmValue **arr, int len)
Utility method for Python API - internal use only.
Definition SaxonProcessor.cpp:933
void setCatalogFiles(const char **catalogFiles, int length)
Definition SaxonProcessor.cpp:751
XdmValue ** createXdmValueArray(int len)
Utility method for working with SaxonC on Python.
Definition SaxonProcessor.h:545
XdmAtomicValue ** createXdmAtomicValueArray(int len)
Utility method for working with SaxonC on Python.
Definition SaxonProcessor.h:556
XQueryProcessor * newXQueryProcessor()
Create an XQueryProcessor.
Definition SaxonProcessor.cpp:671
static void deleteString(const char *data, char deleteFlag=0)
Definition SaxonProcessor.h:736
const char * version()
Get the Saxon version.
Definition SaxonProcessor.cpp:692
Xslt30Processor * newXslt30Processor()
Create an Xslt30Processor.
Definition SaxonProcessor.cpp:665
std::string cwd
Definition SaxonProcessor.h:728
void deleteXdmAtomicValueArray(XdmAtomicValue **arr, int len)
Utility method for Python API - internal use only.
Definition SaxonProcessor.cpp:939
static void attachCurrentThread()
Attaches a current thread to the a Java VM.
Definition SaxonProcessor.cpp:270
std::string versionStr
Definition SaxonProcessor.h:761
XdmAtomicValue * makeLongValue(long l)
Definition SaxonProcessor.cpp:992
bool licensei
Definition SaxonProcessor.h:768
~SaxonProcessor()
Definition SaxonProcessor.cpp:330
std::map< std::string, std::string > configProperties
Definition SaxonProcessor.h:766
bool isSchemaAwareProcessor()
Test whether this processor is schema-aware.
Definition SaxonProcessor.cpp:353
SaxonProcessor & operator=(const SaxonProcessor &other)
The copy assignment= operator.
Definition SaxonProcessor.cpp:631
int getNodeKind(int64_t obj)
Get the kind of node.
Definition SaxonProcessor.cpp:846
SaxonApiException * exception
Definition SaxonProcessor.h:777
DocumentBuilder * newDocumentBuilder()
Create a DocumentBuilder.
Definition SaxonProcessor.cpp:655
XdmMap * makeMap(std::map< XdmAtomicValue *, XdmValue * > dataMap)
Make an XdmMap whose argument is a map from the standard template library.
Definition SaxonProcessor.cpp:1181
XdmArray * makeArray(const char **input, int length)
Make an XdmArray whose members are from string representation.
Definition SaxonProcessor.cpp:1158
static int jvmCreatedCPP
Add a native method.
Definition SaxonProcessor.h:723
XdmNode * parseXmlFromString(const char *source, const char *encoding=nullptr, SchemaValidator *validator=nullptr)
Definition SaxonProcessor.cpp:825
XPathProcessor * newXPathProcessor()
Definition SaxonProcessor.cpp:676
int64_t procRef
ObjectHandle reference to the underlying processor.
Definition SaxonProcessor.h:771
XdmAtomicValue * makeFloatValue(float f)
Factory method. make an XdmAtomicValue from a primitive float value.
Definition SaxonProcessor.cpp:985
Definition SchemaValidator.h:25
Definition XPathProcessor.h:63
Definition XQueryProcessor.h:24
Definition XdmAtomicValue.h:26
Definition XdmFunctionItem.h:25
Definition Xslt30Processor.h:28
Definition XsltExecutable.h:29
Definition SaxonCGlue.h:79