source: NonGTP/FCollada/libxml/xmlschemas.h @ 964

Revision 964, 4.7 KB checked in by igarcia, 18 years ago (diff)
Line 
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
25/**
26 * This error codes are obsolete; not used any more.
27 */
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*/
62/**
63 * xmlSchemaValidOption:
64 *
65 * This is the set of XML Schema validation options.
66 */
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
81/**
82 * The schemas related types are kept internal
83 */
84typedef struct _xmlSchema xmlSchema;
85typedef xmlSchema *xmlSchemaPtr;
86
87/**
88 * A schemas validation context
89 */
90typedef void (*xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...);
91typedef void (*xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...);
92
93typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
94typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
95
96typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
97typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
98
99/*
100 * Interfaces for parsing.
101 */
102XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
103            xmlSchemaNewParserCtxt      (const char *URL);
104XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
105            xmlSchemaNewMemParserCtxt   (const char *buffer,
106                                         int size);
107XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
108            xmlSchemaNewDocParserCtxt   (xmlDocPtr doc);
109XMLPUBFUN void XMLCALL         
110            xmlSchemaFreeParserCtxt     (xmlSchemaParserCtxtPtr ctxt);
111XMLPUBFUN void XMLCALL         
112            xmlSchemaSetParserErrors    (xmlSchemaParserCtxtPtr ctxt,
113                                         xmlSchemaValidityErrorFunc err,
114                                         xmlSchemaValidityWarningFunc warn,
115                                         void *ctx);
116XMLPUBFUN int XMLCALL
117                xmlSchemaGetParserErrors        (xmlSchemaParserCtxtPtr ctxt,
118                                        xmlSchemaValidityErrorFunc * err,
119                                        xmlSchemaValidityWarningFunc * warn,
120                                        void **ctx);
121XMLPUBFUN xmlSchemaPtr XMLCALL 
122            xmlSchemaParse              (xmlSchemaParserCtxtPtr ctxt);
123XMLPUBFUN void XMLCALL         
124            xmlSchemaFree               (xmlSchemaPtr schema);
125#ifdef LIBXML_OUTPUT_ENABLED
126XMLPUBFUN void XMLCALL         
127            xmlSchemaDump               (FILE *output,
128                                         xmlSchemaPtr schema);
129#endif /* LIBXML_OUTPUT_ENABLED */
130/*
131 * Interfaces for validating
132 */
133XMLPUBFUN void XMLCALL         
134            xmlSchemaSetValidErrors     (xmlSchemaValidCtxtPtr ctxt,
135                                         xmlSchemaValidityErrorFunc err,
136                                         xmlSchemaValidityWarningFunc warn,
137                                         void *ctx);
138XMLPUBFUN int XMLCALL
139            xmlSchemaGetValidErrors     (xmlSchemaValidCtxtPtr ctxt,
140                                         xmlSchemaValidityErrorFunc *err,
141                                         xmlSchemaValidityWarningFunc *warn,
142                                         void **ctx);
143XMLPUBFUN int XMLCALL
144            xmlSchemaSetValidOptions    (xmlSchemaValidCtxtPtr ctxt,
145                                         int options);
146XMLPUBFUN int XMLCALL
147            xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
148
149XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
150            xmlSchemaNewValidCtxt       (xmlSchemaPtr schema);
151XMLPUBFUN void XMLCALL                 
152            xmlSchemaFreeValidCtxt      (xmlSchemaValidCtxtPtr ctxt);
153XMLPUBFUN int XMLCALL                   
154            xmlSchemaValidateDoc        (xmlSchemaValidCtxtPtr ctxt,
155                                         xmlDocPtr instance);
156XMLPUBFUN int XMLCALL
157            xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
158                                         xmlNodePtr elem);
159XMLPUBFUN int XMLCALL                   
160            xmlSchemaValidateStream     (xmlSchemaValidCtxtPtr ctxt,
161                                         xmlParserInputBufferPtr input,
162                                         xmlCharEncoding enc,
163                                         xmlSAXHandlerPtr sax,
164                                         void *user_data);
165#ifdef __cplusplus
166}
167#endif
168
169#endif /* LIBXML_SCHEMAS_ENABLED */
170#endif /* __XML_SCHEMA_H__ */
Note: See TracBrowser for help on using the repository browser.