ReactOS  0.4.13-dev-698-g77671f0
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
22 extern "C" {
23 #endif
24 
28 typedef 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 */
67 typedef 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 
84 typedef struct _xmlSchema xmlSchema;
85 typedef xmlSchema *xmlSchemaPtr;
86 
95 typedef void (XMLCDECL *xmlSchemaValidityErrorFunc)
96  (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
97 
106 typedef void (XMLCDECL *xmlSchemaValidityWarningFunc)
107  (void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
108 
112 typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
113 typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
114 
115 typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
116 typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
117 
131 typedef int (XMLCDECL *xmlSchemaValidityLocatorFunc) (void *ctx,
132  const char **file, unsigned long *line);
133 
134 /*
135  * Interfaces for parsing.
136  */
137 XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
138  xmlSchemaNewParserCtxt (const char *URL);
139 XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
140  xmlSchemaNewMemParserCtxt (const char *buffer,
141  int size);
142 XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
143  xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
144 XMLPUBFUN void XMLCALL
145  xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
146 XMLPUBFUN void XMLCALL
147  xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
148  xmlSchemaValidityErrorFunc err,
149  xmlSchemaValidityWarningFunc warn,
150  void *ctx);
151 XMLPUBFUN void XMLCALL
152  xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt,
153  xmlStructuredErrorFunc serror,
154  void *ctx);
155 XMLPUBFUN int XMLCALL
156  xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
157  xmlSchemaValidityErrorFunc * err,
158  xmlSchemaValidityWarningFunc * warn,
159  void **ctx);
160 XMLPUBFUN int XMLCALL
161  xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt);
162 
163 XMLPUBFUN xmlSchemaPtr XMLCALL
164  xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
165 XMLPUBFUN void XMLCALL
166  xmlSchemaFree (xmlSchemaPtr schema);
167 #ifdef LIBXML_OUTPUT_ENABLED
168 XMLPUBFUN void XMLCALL
169  xmlSchemaDump (FILE *output,
170  xmlSchemaPtr schema);
171 #endif /* LIBXML_OUTPUT_ENABLED */
172 /*
173  * Interfaces for validating
174  */
175 XMLPUBFUN void XMLCALL
176  xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
177  xmlSchemaValidityErrorFunc err,
178  xmlSchemaValidityWarningFunc warn,
179  void *ctx);
180 XMLPUBFUN void XMLCALL
181  xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
182  xmlStructuredErrorFunc serror,
183  void *ctx);
184 XMLPUBFUN int XMLCALL
185  xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
186  xmlSchemaValidityErrorFunc *err,
187  xmlSchemaValidityWarningFunc *warn,
188  void **ctx);
189 XMLPUBFUN int XMLCALL
190  xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt,
191  int options);
192 XMLPUBFUN void XMLCALL
193  xmlSchemaValidateSetFilename(xmlSchemaValidCtxtPtr vctxt,
194  const char *filename);
195 XMLPUBFUN int XMLCALL
196  xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
197 
198 XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
199  xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
200 XMLPUBFUN void XMLCALL
201  xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
202 XMLPUBFUN int XMLCALL
203  xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
205 XMLPUBFUN int XMLCALL
206  xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
207  xmlNodePtr elem);
208 XMLPUBFUN int XMLCALL
209  xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
211  xmlCharEncoding enc,
213  void *user_data);
214 XMLPUBFUN int XMLCALL
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  */
225 typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct;
226 typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr;
227 
228 XMLPUBFUN xmlSchemaSAXPlugPtr XMLCALL
229  xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt,
231  void **user_data);
232 XMLPUBFUN int XMLCALL
233  xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug);
234 
235 
236 XMLPUBFUN void XMLCALL
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__ */
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define warn(...)
GLuint buffer
Definition: glext.h:5915
xmlCharEncoding
Definition: encoding.h:58
#define XMLPUBFUN
Definition: xmlexports.h:30
const char * filename
Definition: ioapi.h:135
static int sax
Definition: xmllint.c:198
static size_t elem
Definition: string.c:68
#define LIBXML_ATTR_FORMAT(fmt, args)
Definition: xmlversion.h:478
GLfloat f
Definition: glext.h:7540
GLsizeiptr size
Definition: glext.h:5919
const char file[]
Definition: icontest.c:11
Definition: tree.h:489
char line[200]
Definition: main.c:97
#define err(...)
GLenum GLenum GLenum input
Definition: glext.h:9031
static HINSTANCE instance
Definition: main.c:40
const WCHAR * schema
#define XMLCDECL
Definition: xmlexports.h:49
Definition: tree.h:551
#define msg(x)
Definition: auth_time.c:54
#define XMLCALL
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31