Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 1 | #ifndef __XML_ERROR_H__ |
| 2 | #define __XML_ERROR_H__ |
Raja R Harinath | d2e3abd | 1998-08-20 21:52:38 +0000 | [diff] [blame] | 3 | |
Daniel Veillard | 361d845 | 2000-04-03 19:48:13 +0000 | [diff] [blame] | 4 | #include <libxml/parser.h> |
Daniel Veillard | e4e5131 | 1999-12-18 15:32:46 +0000 | [diff] [blame] | 5 | #ifdef __cplusplus |
Daniel Veillard | 5cb5ab8 | 1999-12-21 15:35:29 +0000 | [diff] [blame] | 6 | extern "C" { |
Daniel Veillard | e4e5131 | 1999-12-18 15:32:46 +0000 | [diff] [blame] | 7 | #endif |
Raja R Harinath | d2e3abd | 1998-08-20 21:52:38 +0000 | [diff] [blame] | 8 | |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 9 | typedef enum { |
| 10 | XML_ERR_OK = 0, |
| 11 | XML_ERR_INTERNAL_ERROR, |
| 12 | XML_ERR_NO_MEMORY, |
| 13 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 14 | XML_ERR_DOCUMENT_START, /* 3 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 15 | XML_ERR_DOCUMENT_EMPTY, |
| 16 | XML_ERR_DOCUMENT_END, |
| 17 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 18 | XML_ERR_INVALID_HEX_CHARREF, /* 6 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 19 | XML_ERR_INVALID_DEC_CHARREF, |
| 20 | XML_ERR_INVALID_CHARREF, |
| 21 | XML_ERR_INVALID_CHAR, |
| 22 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 23 | XML_ERR_CHARREF_AT_EOF, /* 10 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 24 | 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 Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 36 | XML_ERR_ENTITYREF_NO_NAME, /* 22 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 37 | XML_ERR_ENTITYREF_SEMICOL_MISSING, |
| 38 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 39 | XML_ERR_PEREF_NO_NAME, /* 24 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 40 | XML_ERR_PEREF_SEMICOL_MISSING, |
| 41 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 42 | XML_ERR_UNDECLARED_ENTITY, /* 26 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 43 | XML_WAR_UNDECLARED_ENTITY, |
| 44 | XML_ERR_UNPARSED_ENTITY, |
| 45 | XML_ERR_ENTITY_IS_EXTERNAL, |
| 46 | XML_ERR_ENTITY_IS_PARAMETER, |
| 47 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 48 | XML_ERR_UNKNOWN_ENCODING, /* 31 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 49 | XML_ERR_UNSUPPORTED_ENCODING, |
| 50 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 51 | XML_ERR_STRING_NOT_STARTED, /* 33 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 52 | XML_ERR_STRING_NOT_CLOSED, |
| 53 | XML_ERR_NS_DECL_ERROR, |
| 54 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 55 | XML_ERR_ENTITY_NOT_STARTED, /* 36 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 56 | XML_ERR_ENTITY_NOT_FINISHED, |
| 57 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 58 | XML_ERR_LT_IN_ATTRIBUTE, /* 38 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 59 | XML_ERR_ATTRIBUTE_NOT_STARTED, |
| 60 | XML_ERR_ATTRIBUTE_NOT_FINISHED, |
| 61 | XML_ERR_ATTRIBUTE_WITHOUT_VALUE, |
| 62 | XML_ERR_ATTRIBUTE_REDEFINED, |
| 63 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 64 | XML_ERR_LITERAL_NOT_STARTED, /* 43 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 65 | XML_ERR_LITERAL_NOT_FINISHED, |
| 66 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 67 | XML_ERR_COMMENT_NOT_FINISHED, /* 45 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 68 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 69 | XML_ERR_PI_NOT_STARTED, /* 47 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 70 | XML_ERR_PI_NOT_FINISHED, |
| 71 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 72 | XML_ERR_NOTATION_NOT_STARTED, /* 49 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 73 | XML_ERR_NOTATION_NOT_FINISHED, |
| 74 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 75 | XML_ERR_ATTLIST_NOT_STARTED, /* 51 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 76 | XML_ERR_ATTLIST_NOT_FINISHED, |
| 77 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 78 | XML_ERR_MIXED_NOT_STARTED, /* 53 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 79 | XML_ERR_MIXED_NOT_FINISHED, |
| 80 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 81 | XML_ERR_ELEMCONTENT_NOT_STARTED, /* 55 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 82 | XML_ERR_ELEMCONTENT_NOT_FINISHED, |
| 83 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 84 | XML_ERR_XMLDECL_NOT_STARTED, /* 57 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 85 | XML_ERR_XMLDECL_NOT_FINISHED, |
| 86 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 87 | XML_ERR_CONDSEC_NOT_STARTED, /* 59 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 88 | XML_ERR_CONDSEC_NOT_FINISHED, |
| 89 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 90 | XML_ERR_EXT_SUBSET_NOT_FINISHED, /* 61 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 91 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 92 | XML_ERR_DOCTYPE_NOT_FINISHED, /* 62 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 93 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 94 | XML_ERR_MISPLACED_CDATA_END, /* 63 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 95 | XML_ERR_CDATA_NOT_FINISHED, |
| 96 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 97 | XML_ERR_RESERVED_XML_NAME, /* 65 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 98 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 99 | XML_ERR_SPACE_REQUIRED, /* 66 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 100 | 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 Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 111 | XML_ERR_TAG_NAME_MISMATCH, /* 77 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 112 | XML_ERR_TAG_NOT_FINISED, |
| 113 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 114 | XML_ERR_STANDALONE_VALUE, /* 79 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 115 | |
Daniel Veillard | 7a66ee6 | 1999-09-26 11:31:02 +0000 | [diff] [blame] | 116 | XML_ERR_ENCODING_NAME, /* 80 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 117 | |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 118 | XML_ERR_HYPHEN_IN_COMMENT, /* 81 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 119 | |
Daniel Veillard | cf46199 | 2000-03-14 18:30:20 +0000 | [diff] [blame] | 120 | 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 Veillard | 496a1cf | 2000-05-03 14:20:55 +0000 | [diff] [blame] | 133 | XML_ERR_ENTITY_BOUNDARY, /* 90 */ |
| 134 | XML_ERR_INVALID_URI, /* 91 */ |
| 135 | XML_ERR_URI_FRAGMENT /* 92 */ |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 136 | }xmlParserErrors; |
| 137 | |
Daniel Veillard | d6d7f7b | 2000-10-25 19:56:55 +0000 | [diff] [blame^] | 138 | /* |
| 139 | * Signature of the function to use when there is an error and |
| 140 | * no parsing or validity context available |
| 141 | */ |
| 142 | typedef 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 | |
| 149 | extern xmlGenericErrorFunc xmlGenericError; |
| 150 | extern void *xmlGenericErrorContext; |
| 151 | |
| 152 | /* |
| 153 | * Use the following function to reset the two previous global variables. |
| 154 | */ |
| 155 | void 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 Veillard | b96e643 | 1999-08-29 21:02:19 +0000 | [diff] [blame] | 162 | void xmlParserError (void *ctx, |
| 163 | const char *msg, |
| 164 | ...); |
| 165 | void xmlParserWarning (void *ctx, |
| 166 | const char *msg, |
| 167 | ...); |
| 168 | void xmlParserValidityError (void *ctx, |
| 169 | const char *msg, |
| 170 | ...); |
| 171 | void xmlParserValidityWarning(void *ctx, |
| 172 | const char *msg, |
| 173 | ...); |
| 174 | void xmlParserPrintFileInfo (xmlParserInputPtr input); |
| 175 | void xmlParserPrintFileContext(xmlParserInputPtr input); |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 176 | |
Daniel Veillard | e4e5131 | 1999-12-18 15:32:46 +0000 | [diff] [blame] | 177 | #ifdef __cplusplus |
| 178 | } |
| 179 | #endif |
Daniel Veillard | 7f7d111 | 1999-09-22 09:46:25 +0000 | [diff] [blame] | 180 | #endif /* __XML_ERROR_H__ */ |