SaxonC 13.1.0
Saxon Processor library for C/C++, PHP and Python
Loading...
Searching...
No Matches
Xslt30Processor.h
1
2// Copyright (c) 2022 - 2025 Saxonica Limited.
3// This Source Code Form is subject to the terms of the Mozilla Public License,
4// v. 2.0. If a copy of the MPL was not distributed with this file, You can
5// obtain one at http://mozilla.org/MPL/2.0/. This Source Code Form is
6// "Incompatible With Secondary Licenses", as defined by the Mozilla Public
7// License, v. 2.0.
9
10#ifndef SAXON_XSLT30_H
11#define SAXON_XSLT30_H
12
13#include "saxonc_export.h"
14#include "saxonc/SaxonProcessor.h"
15#include "saxonc/XsdSchema.h"
16
17#include <string>
18
19class SaxonProcessor;
21class XsltExecutable;
22class XdmValue;
23class XdmItem;
24class XdmNode;
25class XsdSchema;
26
31class SAXONC_EXPORT Xslt30Processor {
32
33 friend class XsltExecutable;
34
35public:
42
49 Xslt30Processor(SaxonProcessor *proc, std::string cwd = "");
50
55 Xslt30Processor(const Xslt30Processor &other);
56
58
63 SaxonProcessor *getSaxonProcessor();
64
73 void setcwd(const char *cwd);
74
75
82 const char * getcwd();
83
84
98 void useSchema(XsdSchema * schema, const char * role = "");
99
116 void setSchemaAware(bool schemaAware);
117
118 bool isSchemaAware();
119
129 void setBaseOutputURI(const char *baseURI);
130
148 void setJustInTimeCompilation(bool jit);
149
157 bool getJustInTimeCompilation();
158
164 void setTargetEdition(const char *edition);
165
174 void setXsltLanguageVersion(const char *version);
175
192 void setFastCompilation(bool fast);
193
201 void setRelocatable(bool relocatable);
202
215 void setParameter(const char *name, XdmValue *value);
216
222 XdmValue *getParameter(const char *name);
223
230 bool removeParameter(const char *name);
231
239 std::map<std::string, XdmValue *> &getParameters();
240
248 void clearParameters(bool deleteValues = false);
249
250
254 char **createCharArray(int len) { return (new char *[len]); }
255
262 void deleteXdmValueArray(XdmValue **arr, int len) {
263 delete[] arr;
264 }
265
275 void transformFileToFile(const char *sourcefile, const char *stylesheetfile,
276 const char *outputfile);
277
289 const char *transformFileToString(const char *sourcefile,
290 const char *stylesheetfile);
291
301 XdmValue *transformFileToValue(const char *sourcefile,
302 const char *stylesheetfile);
303
313 void importPackage(const char *packageFile);
314
328 XsltExecutable *compileFromFile(const char *stylesheet);
329
345 XsltExecutable *compileFromString(const char *stylesheet,
346 const char *encoding = nullptr);
347
361 XsltExecutable *compileFromAssociatedFile(const char *sourceFile);
362
371 void compileFromStringAndSave(const char *stylesheet, const char *filename,
372 const char *encoding = nullptr);
373
381 void compileFromFileAndSave(const char *xslFilename, const char *filename);
382
390 void compileFromXdmNodeAndSave(XdmNode *node, const char *filename);
391
405 XsltExecutable *compileFromXdmNode(XdmNode *node);
406
407private:
408
418 void setProperty(const char *name, const char *value);
419
424 std::map<std::string, std::string> &getProperties();
425
429 void clearProperties();
430
431 //SaxonProcessor *proc; /*!< Pointer to the SaxonProcessor object which created this Xslt30Processor */
432
433 int64_t cppXT, procRef;
434 int64_t importPackageValue, schemaRef;
435 std::string cwdXT;
436 bool jitCompilation;
437 std::map<std::string, XdmValue *>
438 parameters;
440 std::map<std::string, std::string>
441 properties;
443};
444
445#endif /* SAXON_XSLT30_H */
SAXONC_EXPORT void setParameter(sxnc_parameter **parameters, int *parLen, int *parCap, const char *name, sxnc_value *value)
Set a parameter.
Definition SaxonCGlue.c:202
SAXONC_EXPORT int64_t getParameter(sxnc_parameter *parameters, int parLen, const char *name)
Get a parameter from the list.
Definition SaxonCGlue.c:178
SAXONC_EXPORT void setProperty(sxnc_property **properties, int *propLen, int *propCap, const char *name, const char *value)
Set a property.
Definition SaxonCGlue.c:228
EXTERN_SAXONC SAXONC_EXPORT const char * version(sxnc_environment *environi, sxnc_processor *proc)
Get the Saxon version.
Definition SaxonCProcessor.c:6
SaxonApiException.
Definition SaxonApiException.h:25
The SaxonProcessor class acts as a factory for generating XQuery, XPath, Schema and XSLT compilers.
Definition SaxonProcessor.h:137
The class XdmItem represents an item in a sequence, as defined by the XDM data model.
Definition XdmItem.h:31
This class represents a node in the XDM data model.
Definition XdmNode.h:57
An XdmValue represents a value in the XDM data model.
Definition XdmValue.h:33
Definition XsdSchema.h:26
An Xslt30Processor represents a factory to compile, load and execute stylesheets.
Definition Xslt30Processor.h:31
char ** createCharArray(int len)
Utility method for working with SaxonC on Python - internal use only.
Definition Xslt30Processor.h:254
void deleteXdmValueArray(XdmValue **arr, int len)
Utility method for Python API - internal use only.
Definition Xslt30Processor.h:262
An XsltExecutable represents the compiled form of a stylesheet.
Definition XsltExecutable.h:33