2 * schemas.h : interface to the XML Schemas handling and schema validity
5 * See Copyright for the status of this software.
7 * Daniel.Veillard@w3.org
11 #ifndef __XML_SCHEMA_H__
12 #define __XML_SCHEMA_H__
14 #include <libxml/xmlversion.h>
16 #ifdef LIBXML_SCHEMAS_ENABLED
18 #include <libxml/tree.h>
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,
49 } xmlSchemaValidError;
53 * The schemas related types are kept internal
55 typedef struct _xmlSchema xmlSchema;
56 typedef xmlSchema *xmlSchemaPtr;
59 * A schemas validation context
61 typedef void (*xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...);
62 typedef void (*xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...);
64 typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
65 typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
67 typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
68 typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
71 * Interfaces for parsing.
73 xmlSchemaParserCtxtPtr xmlSchemaNewParserCtxt (const char *URL);
74 xmlSchemaParserCtxtPtr xmlSchemaNewMemParserCtxt(const char *buffer,
76 void xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
77 void xmlSchemaSetParserErrors(xmlSchemaParserCtxtPtr ctxt,
78 xmlSchemaValidityErrorFunc err,
79 xmlSchemaValidityWarningFunc warn,
81 xmlSchemaPtr xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
82 void xmlSchemaFree (xmlSchemaPtr schema);
83 void xmlSchemaDump (FILE *output,
86 * Interfaces for validating
88 void xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
89 xmlSchemaValidityErrorFunc err,
90 xmlSchemaValidityWarningFunc warn,
92 xmlSchemaValidCtxtPtr xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
93 void xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
94 int xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
96 int xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
97 xmlParserInputBufferPtr input,
105 #endif /* LIBXML_SCHEMAS_ENABLED */
106 #endif /* __XML_SCHEMA_H__ */