ReactOS 0.4.16-dev-334-g4d9f67c
xmlschemas.h
Go to the documentation of this file.
1/*
2 * Summary: incomplete XML Schemas structure implementation
3 * Description: interface to the XML Schemas handling and schema validity
4 * checking, it is incomplete right now.
5 *
6 * Copy: See Copyright for the status of this software.
7 *
8 * Author: Daniel Veillard
9 */
10
11
12#ifndef __XML_SCHEMA_H__
13#define __XML_SCHEMA_H__
14
15#include <libxml/xmlversion.h>
16
17#ifdef LIBXML_SCHEMAS_ENABLED
18
19#include <libxml/tree.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
28typedef enum {
29 XML_SCHEMAS_ERR_OK = 0,
30 XML_SCHEMAS_ERR_NOROOT = 1,
31 XML_SCHEMAS_ERR_UNDECLAREDELEM,
32 XML_SCHEMAS_ERR_NOTTOPLEVEL,
33 XML_SCHEMAS_ERR_MISSING,
34 XML_SCHEMAS_ERR_WRONGELEM,
35 XML_SCHEMAS_ERR_NOTYPE,
36 XML_SCHEMAS_ERR_NOROLLBACK,
37 XML_SCHEMAS_ERR_ISABSTRACT,
38 XML_SCHEMAS_ERR_NOTEMPTY,
39 XML_SCHEMAS_ERR_ELEMCONT,
40 XML_SCHEMAS_ERR_HAVEDEFAULT,
41 XML_SCHEMAS_ERR_NOTNILLABLE,
42 XML_SCHEMAS_ERR_EXTRACONTENT,
43 XML_SCHEMAS_ERR_INVALIDATTR,
44 XML_SCHEMAS_ERR_INVALIDELEM,
45 XML_SCHEMAS_ERR_NOTDETERMINIST,
46 XML_SCHEMAS_ERR_CONSTRUCT,
47 XML_SCHEMAS_ERR_INTERNAL,
48 XML_SCHEMAS_ERR_NOTSIMPLE,
49 XML_SCHEMAS_ERR_ATTRUNKNOWN,
50 XML_SCHEMAS_ERR_ATTRINVALID,
51 XML_SCHEMAS_ERR_VALUE,
52 XML_SCHEMAS_ERR_FACET,
53 XML_SCHEMAS_ERR_,
54 XML_SCHEMAS_ERR_XXX
55} xmlSchemaValidError;
56
57/*
58* ATTENTION: Change xmlSchemaSetValidOptions's check
59* for invalid values, if adding to the validation
60* options below.
61*/
67typedef enum {
68 XML_SCHEMA_VAL_VC_I_CREATE = 1<<0
69 /* Default/fixed: create an attribute node
70 * or an element's text node on the instance.
71 */
72} xmlSchemaValidOption;
73
74/*
75 XML_SCHEMA_VAL_XSI_ASSEMBLE = 1<<1,
76 * assemble schemata using
77 * xsi:schemaLocation and
78 * xsi:noNamespaceSchemaLocation
79*/
80
84typedef struct _xmlSchema xmlSchema;
85typedef xmlSchema *xmlSchemaPtr;
86
95typedef void (XMLCDECL *xmlSchemaValidityErrorFunc)
96 (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
97
106typedef void (XMLCDECL *xmlSchemaValidityWarningFunc)
107 (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
108
112typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
113typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
114
115typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
116typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
117
131typedef int (XMLCDECL *xmlSchemaValidityLocatorFunc) (void *ctx,
132 const char **file, unsigned long *line);
133
134/*
135 * Interfaces for parsing.
136 */
137XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
138 xmlSchemaNewParserCtxt (const char *URL);
139XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
140 xmlSchemaNewMemParserCtxt (const char *buffer,
141 int size);
142XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
143 xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
145 xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
147 xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
148 xmlSchemaValidityErrorFunc err,
149 xmlSchemaValidityWarningFunc warn,
150 void *ctx);
152 xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt,
154 void *ctx);
156 xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
157 xmlSchemaValidityErrorFunc * err,
158 xmlSchemaValidityWarningFunc * warn,
159 void **ctx);
161 xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt);
162
163XMLPUBFUN xmlSchemaPtr XMLCALL
164 xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
166 xmlSchemaFree (xmlSchemaPtr schema);
167#ifdef LIBXML_OUTPUT_ENABLED
169 xmlSchemaDump (FILE *output,
170 xmlSchemaPtr schema);
171#endif /* LIBXML_OUTPUT_ENABLED */
172/*
173 * Interfaces for validating
174 */
176 xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
177 xmlSchemaValidityErrorFunc err,
178 xmlSchemaValidityWarningFunc warn,
179 void *ctx);
181 xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
183 void *ctx);
185 xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
186 xmlSchemaValidityErrorFunc *err,
187 xmlSchemaValidityWarningFunc *warn,
188 void **ctx);
190 xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt,
191 int options);
193 xmlSchemaValidateSetFilename(xmlSchemaValidCtxtPtr vctxt,
194 const char *filename);
196 xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
197
198XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
199 xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
201 xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
203 xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
206 xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
209 xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
211 xmlCharEncoding enc,
213 void *user_data);
215 xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
216 const char * filename,
217 int options);
218
220 xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt);
221
222/*
223 * Interface to insert Schemas SAX validation in a SAX stream
224 */
225typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct;
226typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr;
227
228XMLPUBFUN xmlSchemaSAXPlugPtr XMLCALL
229 xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt,
231 void **user_data);
233 xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug);
234
235
237 xmlSchemaValidateSetLocator (xmlSchemaValidCtxtPtr vctxt,
238 xmlSchemaValidityLocatorFunc f,
239 void *ctxt);
240
241#ifdef __cplusplus
242}
243#endif
244
245#endif /* LIBXML_SCHEMAS_ENABLED */
246#endif /* __XML_SCHEMA_H__ */
#define msg(x)
Definition: auth_time.c:54
static HINSTANCE instance
Definition: main.c:40
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
xmlCharEncoding
Definition: encoding.h:56
#define XMLCALL
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
GLfloat f
Definition: glext.h:7540
GLenum GLenum GLenum input
Definition: glext.h:9031
const char * filename
Definition: ioapi.h:137
const WCHAR * schema
static size_t elem
Definition: string.c:68
#define warn(...)
#define err(...)
Definition: tree.h:551
Definition: tree.h:489
Definition: fci.c:127
Definition: parser.c:49
void(XMLCDECL *) typedef void(XMLCALL * xmlStructuredErrorFunc)(void *userData, xmlErrorPtr error)
Definition: xmlerror.h:858
#define XMLPUBFUN
Definition: xmlexports.h:61
#define XMLCDECL
Definition: xmlexports.h:52
static int sax
Definition: xmllint.c:193
#define LIBXML_ATTR_FORMAT(fmt, args)
Definition: xmlversion.h:486