00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __XML_SCHEMA_H__
00012 #define __XML_SCHEMA_H__
00013
00014 #include <libxml/xmlversion.h>
00015
00016 #ifdef LIBXML_SCHEMAS_ENABLED
00017
00018 #include <libxml/tree.h>
00019
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023
00024 typedef enum {
00025 XML_SCHEMAS_ERR_OK = 0,
00026 XML_SCHEMAS_ERR_NOROOT = 1,
00027 XML_SCHEMAS_ERR_UNDECLAREDELEM,
00028 XML_SCHEMAS_ERR_NOTTOPLEVEL,
00029 XML_SCHEMAS_ERR_MISSING,
00030 XML_SCHEMAS_ERR_WRONGELEM,
00031 XML_SCHEMAS_ERR_NOTYPE,
00032 XML_SCHEMAS_ERR_NOROLLBACK,
00033 XML_SCHEMAS_ERR_ISABSTRACT,
00034 XML_SCHEMAS_ERR_NOTEMPTY,
00035 XML_SCHEMAS_ERR_ELEMCONT,
00036 XML_SCHEMAS_ERR_HAVEDEFAULT,
00037 XML_SCHEMAS_ERR_NOTNILLABLE,
00038 XML_SCHEMAS_ERR_EXTRACONTENT,
00039 XML_SCHEMAS_ERR_INVALIDATTR,
00040 XML_SCHEMAS_ERR_INVALIDELEM,
00041 XML_SCHEMAS_ERR_NOTDETERMINIST,
00042 XML_SCHEMAS_ERR_CONSTRUCT,
00043 XML_SCHEMAS_ERR_INTERNAL,
00044 XML_SCHEMAS_ERR_NOTSIMPLE,
00045 XML_SCHEMAS_ERR_ATTRUNKNOWN,
00046 XML_SCHEMAS_ERR_ATTRINVALID,
00047 XML_SCHEMAS_ERR_VALUE,
00048 XML_SCHEMAS_ERR_FACET,
00049 XML_SCHEMAS_ERR_,
00050 XML_SCHEMAS_ERR_XXX
00051 } xmlSchemaValidError;
00052
00053
00057 typedef struct _xmlSchema xmlSchema;
00058 typedef xmlSchema *xmlSchemaPtr;
00059
00063 typedef void (*xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...);
00064 typedef void (*xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...);
00065
00066 typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
00067 typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
00068
00069 typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
00070 typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
00071
00072
00073
00074
00075 XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
00076 xmlSchemaNewParserCtxt (const char *URL);
00077 XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
00078 xmlSchemaNewMemParserCtxt (const char *buffer,
00079 int size);
00080 XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
00081 xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
00082 XMLPUBFUN void XMLCALL
00083 xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
00084 XMLPUBFUN void XMLCALL
00085 xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
00086 xmlSchemaValidityErrorFunc err,
00087 xmlSchemaValidityWarningFunc warn,
00088 void *ctx);
00089 XMLPUBFUN xmlSchemaPtr XMLCALL
00090 xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
00091 XMLPUBFUN void XMLCALL
00092 xmlSchemaFree (xmlSchemaPtr schema);
00093 #ifdef LIBXML_OUTPUT_ENABLED
00094 XMLPUBFUN void XMLCALL
00095 xmlSchemaDump (FILE *output,
00096 xmlSchemaPtr schema);
00097 #endif
00098
00099
00100
00101 XMLPUBFUN void XMLCALL
00102 xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
00103 xmlSchemaValidityErrorFunc err,
00104 xmlSchemaValidityWarningFunc warn,
00105 void *ctx);
00106 XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
00107 xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
00108 XMLPUBFUN void XMLCALL
00109 xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
00110 XMLPUBFUN int XMLCALL
00111 xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
00112 xmlDocPtr instance);
00113 XMLPUBFUN int XMLCALL
00114 xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
00115 xmlParserInputBufferPtr input,
00116 xmlCharEncoding enc,
00117 xmlSAXHandlerPtr sax,
00118 void *user_data);
00119 #ifdef __cplusplus
00120 }
00121 #endif
00122
00123 #endif
00124 #endif
00125