SaxonC 13.0.0
Saxon Processor library for C/C++, PHP and Python
Loading...
Searching...
No Matches
XsdCompiler.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 XSDCOMPILER_H
11#define XSDCOMPILER_H
12
13#include "saxonc_export.h"
14#include "saxonc/SaxonProcessor.h"
15#include "saxonc/XsdSchema.h"
16
17#include <string>
18#include <vector>
19
20class SaxonProcessor;
21class XdmValue;
22class XdmNode;
23class XdmItem;
24class XsdSchema;
25
49class SAXONC_EXPORT XsdCompiler {
50
51public:
52
59
68 XsdCompiler(SaxonProcessor *proc, std::string cwd = "");
69
74 XsdCompiler(const XsdCompiler &other);
75
80
81
87 //XsdCompiler &operator=(const XsdCompiler &other);
88
94 void setcwd(const char *cwd);
95
101 const char * getcwd();
102
103
111
112 void setXsdVersion(const char* version);
113
119
120 const char * getXsdVersion();
121
128 //TODO maybe some list object void setErrorReporter(ErrorReporter reporter);
129
136
137 //TODO need to report errors in SaxonC ErrorReporter getErrorReporter();
138
139
140
165 XsdSchema * compileFromString(const char * source, const char *encoding = nullptr);
166
167
181
182 XsdSchema * compileFromFiles(const std::vector<std::string>&filenames);
183
198 XsdSchema * compileFromFiles(std::initializer_list<std::string> filenamesList);
199
214 XsdSchema * compileFromFiles(const char ** filenames, int count);
215
216
217
231 XsdSchema * compileFromFile(const char * filename);
232
246 XsdSchema * compileFromNode(XdmNode *node);
247
256 XsdSchema * combine(XsdSchema ** schemas, int num_schemas);
257
264 XsdSchema * emptySchema();
265
275 XsdSchema * importComponents(const char * filename);
276
286 XsdSchema * importComponentsFromNode(XdmNode *node);
287
288 void setProperty(const char *name, const char *value);
289
293 void clearProperties();
294
295
296private:
297
298 friend class XsdSchema;
299
300 int64_t xsdCompilerObj;
301 int64_t procRef;
302 std::string cwdV;
303 std::string
304 xsdVersion;
305 std::map<std::string, XdmValue *>
306 parameters;
308 std::map<std::string, std::string>
309 properties;
311
312};
313
314
315#endif //XSDCOMPILER_H
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
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
void setcwd(const char *cwd)
The copy assignment= operator.
Definition XsdCompiler.cpp:86
XsdSchema * compileFromNode(XdmNode *node)
Load a schema document from Node.
Definition XsdCompiler.cpp:150
XsdSchema * combine(XsdSchema **schemas, int num_schemas)
Combine a set of schemas into one.
Definition XsdCompiler.cpp:359
const char * getcwd()
Get the current working directory set on this validator.
Definition XsdCompiler.cpp:94
XsdSchema * emptySchema()
Return an empty schema.
Definition XsdCompiler.cpp:394
XsdSchema * importComponentsFromNode(XdmNode *node)
Import a precompiled Schema Component Model from a given Source.
Definition XsdCompiler.cpp:405
XsdCompiler()
Default constructor.
Definition XsdCompiler.cpp:15
XsdSchema * importComponents(const char *filename)
Import a precompiled Schema Component Model from a given Source.
Definition XsdCompiler.cpp:427
XsdSchema * compileFromFiles(const std::vector< std::string > &filenames)
Load a schema document from a given File or set of files as a vector.
Definition XsdCompiler.cpp:250
const char * getXsdVersion()
Get the version of XSD in use for this schema.
Definition XsdCompiler.cpp:108
void clearProperties()
Clear configuration property values set.
Definition XsdCompiler.cpp:353
void setXsdVersion(const char *version)
Set the version of XSD in use for this schema.
Definition XsdCompiler.cpp:100
XsdSchema * compileFromString(const char *source, const char *encoding=nullptr)
Set the ErrorReporter to be used while loading and validating schema documents.
Definition XsdCompiler.cpp:114
XsdSchema * compileFromFile(const char *filename)
Load a schema document from a given File or set of files.
Definition XsdCompiler.cpp:310
Definition XsdSchema.h:26