added Info.plist
[TestXSLT.git] / libxml2 / include / libxml / xmlschemas.h
1 /*
2  * schemas.h : interface to the XML Schemas handling and schema validity
3  *             checking
4  *
5  * See Copyright for the status of this software.
6  *
7  * Daniel.Veillard@w3.org
8  */
9
10
11 #ifndef __XML_SCHEMA_H__
12 #define __XML_SCHEMA_H__
13
14 #include <libxml/xmlversion.h>
15
16 #ifdef LIBXML_SCHEMAS_ENABLED
17
18 #include <libxml/tree.h>
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 typedef enum {
25     XML_SCHEMAS_ERR_OK          = 0,
26     XML_SCHEMAS_ERR_NOROOT      = 1,
27     XML_SCHEMAS_ERR_UNDECLAREDELEM,
28     XML_SCHEMAS_ERR_NOTTOPLEVEL,
29     XML_SCHEMAS_ERR_MISSING,
30     XML_SCHEMAS_ERR_WRONGELEM,
31     XML_SCHEMAS_ERR_NOTYPE,
32     XML_SCHEMAS_ERR_NOROLLBACK,
33     XML_SCHEMAS_ERR_ISABSTRACT,
34     XML_SCHEMAS_ERR_NOTEMPTY,
35     XML_SCHEMAS_ERR_ELEMCONT,
36     XML_SCHEMAS_ERR_HAVEDEFAULT,
37     XML_SCHEMAS_ERR_NOTNILLABLE,
38     XML_SCHEMAS_ERR_EXTRACONTENT,
39     XML_SCHEMAS_ERR_INVALIDATTR,
40     XML_SCHEMAS_ERR_INVALIDELEM,
41     XML_SCHEMAS_ERR_NOTDETERMINIST,
42     XML_SCHEMAS_ERR_CONSTRUCT,
43     XML_SCHEMAS_ERR_INTERNAL,
44     XML_SCHEMAS_ERR_NOTSIMPLE,
45     XML_SCHEMAS_ERR_ATTRUNKNOWN,
46     XML_SCHEMAS_ERR_ATTRINVALID,
47     XML_SCHEMAS_ERR_VALUE,
48     XML_SCHEMAS_ERR_FACET,
49     XML_SCHEMAS_ERR_,
50     XML_SCHEMAS_ERR_XXX
51 } xmlSchemaValidError;
52
53
54 /**
55  * The schemas related types are kept internal
56  */
57 typedef struct _xmlSchema xmlSchema;
58 typedef xmlSchema *xmlSchemaPtr;
59
60 /**
61  * A schemas validation context
62  */
63 typedef void (*xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...);
64 typedef void (*xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...);
65
66 typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
67 typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
68
69 typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
70 typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
71
72 /*
73  * Interfaces for parsing.
74  */
75 xmlSchemaParserCtxtPtr xmlSchemaNewParserCtxt   (const char *URL);
76 xmlSchemaParserCtxtPtr xmlSchemaNewMemParserCtxt(const char *buffer,
77                                                  int size);
78 void            xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
79 void            xmlSchemaSetParserErrors(xmlSchemaParserCtxtPtr ctxt,
80                                          xmlSchemaValidityErrorFunc err,
81                                          xmlSchemaValidityWarningFunc warn,
82                                          void *ctx);
83 xmlSchemaPtr    xmlSchemaParse          (xmlSchemaParserCtxtPtr ctxt);
84 void            xmlSchemaFree           (xmlSchemaPtr schema);
85 void            xmlSchemaDump           (FILE *output,
86                                          xmlSchemaPtr schema);
87 /*
88  * Interfaces for validating
89  */
90 void            xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
91                                          xmlSchemaValidityErrorFunc err,
92                                          xmlSchemaValidityWarningFunc warn,
93                                          void *ctx);
94 xmlSchemaValidCtxtPtr   xmlSchemaNewValidCtxt   (xmlSchemaPtr schema);
95 void                    xmlSchemaFreeValidCtxt  (xmlSchemaValidCtxtPtr ctxt);
96 int                     xmlSchemaValidateDoc    (xmlSchemaValidCtxtPtr ctxt,
97                                                  xmlDocPtr instance);
98 int                     xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
99                                                  xmlParserInputBufferPtr input,
100                                                  xmlCharEncoding enc,
101                                                  xmlSAXHandlerPtr sax,
102                                                  void *user_data);
103 #ifdef __cplusplus
104 }
105 #endif
106
107 #endif /* LIBXML_SCHEMAS_ENABLED */
108 #endif /* __XML_SCHEMA_H__ */