SaxonC 12.5
Saxon Processor library for C/C++, PHP and Python
Loading...
Searching...
No Matches
DocumentBuilder.h
1
2// Copyright (c) 2022 - 2023 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 DOCUMENT_BUILDER_H
11#define DOCUMENT_BUILDER_H
12
13#include "SaxonProcessor.h"
14//#include "XdmValue.h"
15#include <string>
16
17class SaxonProcessor;
19class XdmNode;
20class SchemaValidator;
21
36
37 friend class SaxonProcessor;
38
39public:
44
62 void setLineNumbering(bool option);
63
73 bool isLineNumbering();
74
88 void setSchemaValidator(SchemaValidator *validator);
89
97
106 void setDTDValidation(bool option);
107
115 bool isDTDValidation();
116
130 void setBaseUri(const char *uri);
131
139 const char *getBaseUri();
140
155 XdmNode *parseXmlFromString(const char *content,
156 const char *encoding = nullptr);
157
167 XdmNode *parseXmlFromFile(const char *filename);
168
180 XdmNode *parseXmlFromUri(const char *source);
181
188 bool exceptionOccurred();
189
191 void exceptionClear();
192
194
198 const char *getErrorMessage();
199
201
206 const char *getErrorCode();
207
209
215
216private:
226
228
232 DocumentBuilder(SaxonProcessor *p, int64_t docBuilderObject, std::string cwd);
233
238 DocumentBuilder(const DocumentBuilder &other);
239
240 void createException(const char *message = nullptr);
241
242 SchemaValidator *schemaValidator;
243 SaxonProcessor *proc;
244 SaxonApiException *exception;
245 int64_t docBuilderObject;
246 // jclass docBuilderClass, procClass;
247 // jclass saxonCAPIClass;
248 std::string baseURI;
249 std::string cwdDB;
250 bool lineNumbering, dtdVal;
251};
252
253#endif /* DOCUMENT_BUILDER_H */
Definition DocumentBuilder.h:35
void setLineNumbering(bool option)
Definition DocumentBuilder.cpp:53
SaxonApiException * getException()
Get the SaxonApiException object created when we have an error.
Definition DocumentBuilder.cpp:162
XdmNode * parseXmlFromFile(const char *filename)
Definition DocumentBuilder.cpp:118
SchemaValidator * getSchemaValidator()
Definition DocumentBuilder.cpp:68
XdmNode * parseXmlFromString(const char *content, const char *encoding=nullptr)
Definition DocumentBuilder.cpp:98
~DocumentBuilder()
Definition DocumentBuilder.cpp:43
const char * getErrorMessage()
Get the error message if an error has been reported by JNI.
Definition DocumentBuilder.cpp:160
void setSchemaValidator(SchemaValidator *validator)
Definition DocumentBuilder.cpp:64
bool isLineNumbering()
Definition DocumentBuilder.cpp:62
void setBaseUri(const char *uri)
Definition DocumentBuilder.cpp:83
const char * getBaseUri()
Definition DocumentBuilder.cpp:96
bool isDTDValidation()
Definition DocumentBuilder.cpp:81
XdmNode * parseXmlFromUri(const char *source)
Definition DocumentBuilder.cpp:135
const char * getErrorCode()
Get the error code if an error has been reported by JNI.
Definition DocumentBuilder.cpp:158
void exceptionClear()
Clear any exception thrown.
Definition DocumentBuilder.cpp:153
void setDTDValidation(bool option)
Definition DocumentBuilder.cpp:72
bool exceptionOccurred()
Definition DocumentBuilder.cpp:164
Definition SaxonApiException.h:23
Definition SaxonProcessor.h:117
Definition SchemaValidator.h:25
Definition XdmNode.h:56