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.
6 * Copy: See Copyright for the status of this software.
8 * Author: Daniel Veillard
9 * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
20 #include <stdapis/libxml2/libxml2_xmlversion.h>
22 #ifdef LIBXML_SCHEMAS_ENABLED
24 #include <stdapis/libxml2/libxml2_tree.h>
31 XML_SCHEMAS_ERR_OK = 0,
32 XML_SCHEMAS_ERR_NOROOT = 1,
33 XML_SCHEMAS_ERR_UNDECLAREDELEM,
34 XML_SCHEMAS_ERR_NOTTOPLEVEL,
35 XML_SCHEMAS_ERR_MISSING,
36 XML_SCHEMAS_ERR_WRONGELEM,
37 XML_SCHEMAS_ERR_NOTYPE,
38 XML_SCHEMAS_ERR_NOROLLBACK,
39 XML_SCHEMAS_ERR_ISABSTRACT,
40 XML_SCHEMAS_ERR_NOTEMPTY,
41 XML_SCHEMAS_ERR_ELEMCONT,
42 XML_SCHEMAS_ERR_HAVEDEFAULT,
43 XML_SCHEMAS_ERR_NOTNILLABLE,
44 XML_SCHEMAS_ERR_EXTRACONTENT,
45 XML_SCHEMAS_ERR_INVALIDATTR,
46 XML_SCHEMAS_ERR_INVALIDELEM,
47 XML_SCHEMAS_ERR_NOTDETERMINIST,
48 XML_SCHEMAS_ERR_CONSTRUCT,
49 XML_SCHEMAS_ERR_INTERNAL,
50 XML_SCHEMAS_ERR_NOTSIMPLE,
51 XML_SCHEMAS_ERR_ATTRUNKNOWN,
52 XML_SCHEMAS_ERR_ATTRINVALID,
53 XML_SCHEMAS_ERR_VALUE,
54 XML_SCHEMAS_ERR_FACET,
57 } xmlSchemaValidError;
61 * The schemas related types are kept internal
63 typedef struct _xmlSchema xmlSchema;
64 typedef xmlSchema *xmlSchemaPtr;
67 * A schemas validation context
69 typedef void (*xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...);
70 typedef void (*xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...);
72 typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
73 typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
75 typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
76 typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
79 * Interfaces for parsing.
81 XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
82 xmlSchemaNewParserCtxt (const char *URL);
83 XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
84 xmlSchemaNewMemParserCtxt (const char *buffer,
86 XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
87 xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
88 XMLPUBFUN void XMLCALL
89 xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
90 XMLPUBFUN void XMLCALL
91 xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
92 xmlSchemaValidityErrorFunc err,
93 xmlSchemaValidityWarningFunc warn,
95 XMLPUBFUN xmlSchemaPtr XMLCALL
96 xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
97 XMLPUBFUN void XMLCALL
98 xmlSchemaFree (xmlSchemaPtr schema);
99 #ifdef LIBXML_OUTPUT_ENABLED
100 XMLPUBFUN void XMLCALL
101 xmlSchemaDump (FILE *output,
102 xmlSchemaPtr schema);
103 #endif /* LIBXML_OUTPUT_ENABLED */
105 * Interfaces for validating
107 XMLPUBFUN void XMLCALL
108 xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
109 xmlSchemaValidityErrorFunc err,
110 xmlSchemaValidityWarningFunc warn,
112 XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
113 xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
114 XMLPUBFUN void XMLCALL
115 xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
116 XMLPUBFUN int XMLCALL
117 xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
119 XMLPUBFUN int XMLCALL
120 xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
121 xmlParserInputBufferPtr input,
123 xmlSAXHandlerPtr sax,
129 #endif /* LIBXML_SCHEMAS_ENABLED */
130 #endif /* XML_SCHEMA_H */