blob: fa675abe4af3992f1a85ce32d982782e0d6362bd [file] [log] [blame]
Daniel Veillard7f7d1111999-09-22 09:46:25 +00001#ifndef __XML_ERROR_H__
2#define __XML_ERROR_H__
Raja R Harinathd2e3abd1998-08-20 21:52:38 +00003
Daniel Veillard361d8452000-04-03 19:48:13 +00004#include <libxml/parser.h>
Daniel Veillarde4e51311999-12-18 15:32:46 +00005#ifdef __cplusplus
Daniel Veillard5cb5ab81999-12-21 15:35:29 +00006extern "C" {
Daniel Veillarde4e51311999-12-18 15:32:46 +00007#endif
Raja R Harinathd2e3abd1998-08-20 21:52:38 +00008
Daniel Veillard7f7d1111999-09-22 09:46:25 +00009typedef enum {
10 XML_ERR_OK = 0,
11 XML_ERR_INTERNAL_ERROR,
12 XML_ERR_NO_MEMORY,
13
Daniel Veillard7a66ee61999-09-26 11:31:02 +000014 XML_ERR_DOCUMENT_START, /* 3 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000015 XML_ERR_DOCUMENT_EMPTY,
16 XML_ERR_DOCUMENT_END,
17
Daniel Veillard7a66ee61999-09-26 11:31:02 +000018 XML_ERR_INVALID_HEX_CHARREF, /* 6 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000019 XML_ERR_INVALID_DEC_CHARREF,
20 XML_ERR_INVALID_CHARREF,
21 XML_ERR_INVALID_CHAR,
22
Daniel Veillard7a66ee61999-09-26 11:31:02 +000023 XML_ERR_CHARREF_AT_EOF, /* 10 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000024 XML_ERR_CHARREF_IN_PROLOG,
25 XML_ERR_CHARREF_IN_EPILOG,
26 XML_ERR_CHARREF_IN_DTD,
27 XML_ERR_ENTITYREF_AT_EOF,
28 XML_ERR_ENTITYREF_IN_PROLOG,
29 XML_ERR_ENTITYREF_IN_EPILOG,
30 XML_ERR_ENTITYREF_IN_DTD,
31 XML_ERR_PEREF_AT_EOF,
32 XML_ERR_PEREF_IN_PROLOG,
33 XML_ERR_PEREF_IN_EPILOG,
34 XML_ERR_PEREF_IN_INT_SUBSET,
35
Daniel Veillard7a66ee61999-09-26 11:31:02 +000036 XML_ERR_ENTITYREF_NO_NAME, /* 22 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000037 XML_ERR_ENTITYREF_SEMICOL_MISSING,
38
Daniel Veillard7a66ee61999-09-26 11:31:02 +000039 XML_ERR_PEREF_NO_NAME, /* 24 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000040 XML_ERR_PEREF_SEMICOL_MISSING,
41
Daniel Veillard7a66ee61999-09-26 11:31:02 +000042 XML_ERR_UNDECLARED_ENTITY, /* 26 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000043 XML_WAR_UNDECLARED_ENTITY,
44 XML_ERR_UNPARSED_ENTITY,
45 XML_ERR_ENTITY_IS_EXTERNAL,
46 XML_ERR_ENTITY_IS_PARAMETER,
47
Daniel Veillard7a66ee61999-09-26 11:31:02 +000048 XML_ERR_UNKNOWN_ENCODING, /* 31 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000049 XML_ERR_UNSUPPORTED_ENCODING,
50
Daniel Veillard7a66ee61999-09-26 11:31:02 +000051 XML_ERR_STRING_NOT_STARTED, /* 33 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000052 XML_ERR_STRING_NOT_CLOSED,
53 XML_ERR_NS_DECL_ERROR,
54
Daniel Veillard7a66ee61999-09-26 11:31:02 +000055 XML_ERR_ENTITY_NOT_STARTED, /* 36 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000056 XML_ERR_ENTITY_NOT_FINISHED,
57
Daniel Veillard7a66ee61999-09-26 11:31:02 +000058 XML_ERR_LT_IN_ATTRIBUTE, /* 38 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000059 XML_ERR_ATTRIBUTE_NOT_STARTED,
60 XML_ERR_ATTRIBUTE_NOT_FINISHED,
61 XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
62 XML_ERR_ATTRIBUTE_REDEFINED,
63
Daniel Veillard7a66ee61999-09-26 11:31:02 +000064 XML_ERR_LITERAL_NOT_STARTED, /* 43 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000065 XML_ERR_LITERAL_NOT_FINISHED,
66
Daniel Veillard7a66ee61999-09-26 11:31:02 +000067 XML_ERR_COMMENT_NOT_FINISHED, /* 45 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000068
Daniel Veillard7a66ee61999-09-26 11:31:02 +000069 XML_ERR_PI_NOT_STARTED, /* 47 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000070 XML_ERR_PI_NOT_FINISHED,
71
Daniel Veillard7a66ee61999-09-26 11:31:02 +000072 XML_ERR_NOTATION_NOT_STARTED, /* 49 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000073 XML_ERR_NOTATION_NOT_FINISHED,
74
Daniel Veillard7a66ee61999-09-26 11:31:02 +000075 XML_ERR_ATTLIST_NOT_STARTED, /* 51 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000076 XML_ERR_ATTLIST_NOT_FINISHED,
77
Daniel Veillard7a66ee61999-09-26 11:31:02 +000078 XML_ERR_MIXED_NOT_STARTED, /* 53 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000079 XML_ERR_MIXED_NOT_FINISHED,
80
Daniel Veillard7a66ee61999-09-26 11:31:02 +000081 XML_ERR_ELEMCONTENT_NOT_STARTED, /* 55 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000082 XML_ERR_ELEMCONTENT_NOT_FINISHED,
83
Daniel Veillard7a66ee61999-09-26 11:31:02 +000084 XML_ERR_XMLDECL_NOT_STARTED, /* 57 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000085 XML_ERR_XMLDECL_NOT_FINISHED,
86
Daniel Veillard7a66ee61999-09-26 11:31:02 +000087 XML_ERR_CONDSEC_NOT_STARTED, /* 59 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000088 XML_ERR_CONDSEC_NOT_FINISHED,
89
Daniel Veillard7a66ee61999-09-26 11:31:02 +000090 XML_ERR_EXT_SUBSET_NOT_FINISHED, /* 61 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000091
Daniel Veillard7a66ee61999-09-26 11:31:02 +000092 XML_ERR_DOCTYPE_NOT_FINISHED, /* 62 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000093
Daniel Veillard7a66ee61999-09-26 11:31:02 +000094 XML_ERR_MISPLACED_CDATA_END, /* 63 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000095 XML_ERR_CDATA_NOT_FINISHED,
96
Daniel Veillard7a66ee61999-09-26 11:31:02 +000097 XML_ERR_RESERVED_XML_NAME, /* 65 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +000098
Daniel Veillard7a66ee61999-09-26 11:31:02 +000099 XML_ERR_SPACE_REQUIRED, /* 66 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000100 XML_ERR_SEPARATOR_REQUIRED,
101 XML_ERR_NMTOKEN_REQUIRED,
102 XML_ERR_NAME_REQUIRED,
103 XML_ERR_PCDATA_REQUIRED,
104 XML_ERR_URI_REQUIRED,
105 XML_ERR_PUBID_REQUIRED,
106 XML_ERR_LT_REQUIRED,
107 XML_ERR_GT_REQUIRED,
108 XML_ERR_LTSLASH_REQUIRED,
109 XML_ERR_EQUAL_REQUIRED,
110
Daniel Veillard7a66ee61999-09-26 11:31:02 +0000111 XML_ERR_TAG_NAME_MISMATCH, /* 77 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000112 XML_ERR_TAG_NOT_FINISED,
113
Daniel Veillard7a66ee61999-09-26 11:31:02 +0000114 XML_ERR_STANDALONE_VALUE, /* 79 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000115
Daniel Veillard7a66ee61999-09-26 11:31:02 +0000116 XML_ERR_ENCODING_NAME, /* 80 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000117
Daniel Veillardcf461992000-03-14 18:30:20 +0000118 XML_ERR_HYPHEN_IN_COMMENT, /* 81 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000119
Daniel Veillardcf461992000-03-14 18:30:20 +0000120 XML_ERR_INVALID_ENCODING, /* 82 */
121
122 XML_ERR_EXT_ENTITY_STANDALONE, /* 83 */
123
124 XML_ERR_CONDSEC_INVALID, /* 84 */
125
126 XML_ERR_VALUE_REQUIRED, /* 85 */
127
128 XML_ERR_NOT_WELL_BALANCED, /* 86 */
129 XML_ERR_EXTRA_CONTENT, /* 87 */
130 XML_ERR_ENTITY_CHAR_ERROR, /* 88 */
131 XML_ERR_ENTITY_PE_INTERNAL, /* 88 */
132 XML_ERR_ENTITY_LOOP, /* 89 */
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000133 XML_ERR_ENTITY_BOUNDARY, /* 90 */
134 XML_ERR_INVALID_URI, /* 91 */
135 XML_ERR_URI_FRAGMENT /* 92 */
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000136}xmlParserErrors;
137
Daniel Veillardd6d7f7b2000-10-25 19:56:55 +0000138/*
139 * Signature of the function to use when there is an error and
140 * no parsing or validity context available
141 */
142typedef void (*xmlGenericErrorFunc) (void *ctx, const char *msg, ...);
143
144/*
145 * Those are the default error function and associated context to use
146 * when when there is an error and no parsing or validity context available
147 */
148
149extern xmlGenericErrorFunc xmlGenericError;
150extern void *xmlGenericErrorContext;
151
152/*
153 * Use the following function to reset the two previous global variables.
154 */
155void xmlSetGenericErrorFunc (void *ctx,
156 xmlGenericErrorFunc handler);
157
158/*
159 * Default message routines used by SAX and Valid context for error
160 * and warning reporting
161 */
Daniel Veillardb96e6431999-08-29 21:02:19 +0000162void xmlParserError (void *ctx,
163 const char *msg,
164 ...);
165void xmlParserWarning (void *ctx,
166 const char *msg,
167 ...);
168void xmlParserValidityError (void *ctx,
169 const char *msg,
170 ...);
171void xmlParserValidityWarning(void *ctx,
172 const char *msg,
173 ...);
174void xmlParserPrintFileInfo (xmlParserInputPtr input);
175void xmlParserPrintFileContext(xmlParserInputPtr input);
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000176
Daniel Veillarde4e51311999-12-18 15:32:46 +0000177#ifdef __cplusplus
178}
179#endif
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000180#endif /* __XML_ERROR_H__ */