| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="lib.html" title='Python Library Reference' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='index' href='genindex.html' title='Index' /> |
| 10 | <link rel='last' href='about.html' title='About this document...' /> |
| 11 | <link rel='help' href='about.html' title='About this document...' /> |
| 12 | <link rel="prev" href="expat-content-models.html" /> |
| 13 | <link rel="parent" href="module-xml.parsers.expat.html" /> |
| 14 | <link rel="next" href="module-xml.dom.html" /> |
| 15 | <meta name='aesop' content='information' /> |
| 16 | <title>13.5.5 Expat error constants </title> |
| 17 | </head> |
| 18 | <body> |
| 19 | <DIV CLASS="navigation"> |
| 20 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 21 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 22 | <tr> |
| 23 | <td class='online-navigation'><a rel="prev" title="13.5.4 Content Model Descriptions" |
| 24 | href="expat-content-models.html"><img src='../icons/previous.png' |
| 25 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 26 | <td class='online-navigation'><a rel="parent" title="13.5 xml.parsers.expat " |
| 27 | href="module-xml.parsers.expat.html"><img src='../icons/up.png' |
| 28 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 29 | <td class='online-navigation'><a rel="next" title="13.6 xml.dom " |
| 30 | href="module-xml.dom.html"><img src='../icons/next.png' |
| 31 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 32 | <td align="center" width="100%">Python Library Reference</td> |
| 33 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 34 | href="contents.html"><img src='../icons/contents.png' |
| 35 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 36 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 37 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 38 | <td class='online-navigation'><a rel="index" title="Index" |
| 39 | href="genindex.html"><img src='../icons/index.png' |
| 40 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 41 | </tr></table> |
| 42 | <div class='online-navigation'> |
| 43 | <b class="navlabel">Previous:</b> |
| 44 | <a class="sectref" rel="prev" href="expat-content-models.html">13.5.4 Content Model Descriptions</A> |
| 45 | <b class="navlabel">Up:</b> |
| 46 | <a class="sectref" rel="parent" href="module-xml.parsers.expat.html">13.5 xml.parsers.expat </A> |
| 47 | <b class="navlabel">Next:</b> |
| 48 | <a class="sectref" rel="next" href="module-xml.dom.html">13.6 xml.dom </A> |
| 49 | </div> |
| 50 | <hr /></div> |
| 51 | </DIV> |
| 52 | <!--End of Navigation Panel--> |
| 53 | |
| 54 | <H2><A NAME="SECTION0015550000000000000000"></A><A NAME="expat-errors"></A> |
| 55 | <BR> |
| 56 | 13.5.5 Expat error constants |
| 57 | </H2> |
| 58 | |
| 59 | <P> |
| 60 | The following constants are provided in the <code>errors</code> object of |
| 61 | the <tt class="module"><a href="module-xml.parsers.expat.html">xml.parsers.expat</a></tt> module. These constants are useful |
| 62 | in interpreting some of the attributes of the <tt class="exception">ExpatError</tt> |
| 63 | exception objects raised when an error has occurred. |
| 64 | |
| 65 | <P> |
| 66 | The <code>errors</code> object has the following attributes: |
| 67 | |
| 68 | <P> |
| 69 | <dl><dt><b><tt>XML_ERROR_ASYNC_ENTITY</tt></b></dt> |
| 70 | <dd> |
| 71 | </dd></dl> |
| 72 | |
| 73 | <P> |
| 74 | <dl><dt><b><tt>XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF</tt></b></dt> |
| 75 | <dd> |
| 76 | An entity reference in an attribute value referred to an external |
| 77 | entity instead of an internal entity. |
| 78 | </dd></dl> |
| 79 | |
| 80 | <P> |
| 81 | <dl><dt><b><tt>XML_ERROR_BAD_CHAR_REF</tt></b></dt> |
| 82 | <dd> |
| 83 | A character reference referred to a character which is illegal in XML |
| 84 | (for example, character <code>0</code>, or `<code>&#0;</code>'). |
| 85 | </dd></dl> |
| 86 | |
| 87 | <P> |
| 88 | <dl><dt><b><tt>XML_ERROR_BINARY_ENTITY_REF</tt></b></dt> |
| 89 | <dd> |
| 90 | An entity reference referred to an entity which was declared with a |
| 91 | notation, so cannot be parsed. |
| 92 | </dd></dl> |
| 93 | |
| 94 | <P> |
| 95 | <dl><dt><b><tt>XML_ERROR_DUPLICATE_ATTRIBUTE</tt></b></dt> |
| 96 | <dd> |
| 97 | An attribute was used more than once in a start tag. |
| 98 | </dd></dl> |
| 99 | |
| 100 | <P> |
| 101 | <dl><dt><b><tt>XML_ERROR_INCORRECT_ENCODING</tt></b></dt> |
| 102 | <dd> |
| 103 | </dd></dl> |
| 104 | |
| 105 | <P> |
| 106 | <dl><dt><b><tt>XML_ERROR_INVALID_TOKEN</tt></b></dt> |
| 107 | <dd> |
| 108 | Raised when an input byte could not properly be assigned to a |
| 109 | character; for example, a NUL byte (value <code>0</code>) in a UTF-8 input |
| 110 | stream. |
| 111 | </dd></dl> |
| 112 | |
| 113 | <P> |
| 114 | <dl><dt><b><tt>XML_ERROR_JUNK_AFTER_DOC_ELEMENT</tt></b></dt> |
| 115 | <dd> |
| 116 | Something other than whitespace occurred after the document element. |
| 117 | </dd></dl> |
| 118 | |
| 119 | <P> |
| 120 | <dl><dt><b><tt>XML_ERROR_MISPLACED_XML_PI</tt></b></dt> |
| 121 | <dd> |
| 122 | An XML declaration was found somewhere other than the start of the |
| 123 | input data. |
| 124 | </dd></dl> |
| 125 | |
| 126 | <P> |
| 127 | <dl><dt><b><tt>XML_ERROR_NO_ELEMENTS</tt></b></dt> |
| 128 | <dd> |
| 129 | The document contains no elements (XML requires all documents to |
| 130 | contain exactly one top-level element).. |
| 131 | </dd></dl> |
| 132 | |
| 133 | <P> |
| 134 | <dl><dt><b><tt>XML_ERROR_NO_MEMORY</tt></b></dt> |
| 135 | <dd> |
| 136 | Expat was not able to allocate memory internally. |
| 137 | </dd></dl> |
| 138 | |
| 139 | <P> |
| 140 | <dl><dt><b><tt>XML_ERROR_PARAM_ENTITY_REF</tt></b></dt> |
| 141 | <dd> |
| 142 | A parameter entity reference was found where it was not allowed. |
| 143 | </dd></dl> |
| 144 | |
| 145 | <P> |
| 146 | <dl><dt><b><tt>XML_ERROR_PARTIAL_CHAR</tt></b></dt> |
| 147 | <dd> |
| 148 | An incomplete character was found in the input. |
| 149 | </dd></dl> |
| 150 | |
| 151 | <P> |
| 152 | <dl><dt><b><tt>XML_ERROR_RECURSIVE_ENTITY_REF</tt></b></dt> |
| 153 | <dd> |
| 154 | An entity reference contained another reference to the same entity; |
| 155 | possibly via a different name, and possibly indirectly. |
| 156 | </dd></dl> |
| 157 | |
| 158 | <P> |
| 159 | <dl><dt><b><tt>XML_ERROR_SYNTAX</tt></b></dt> |
| 160 | <dd> |
| 161 | Some unspecified syntax error was encountered. |
| 162 | </dd></dl> |
| 163 | |
| 164 | <P> |
| 165 | <dl><dt><b><tt>XML_ERROR_TAG_MISMATCH</tt></b></dt> |
| 166 | <dd> |
| 167 | An end tag did not match the innermost open start tag. |
| 168 | </dd></dl> |
| 169 | |
| 170 | <P> |
| 171 | <dl><dt><b><tt>XML_ERROR_UNCLOSED_TOKEN</tt></b></dt> |
| 172 | <dd> |
| 173 | Some token (such as a start tag) was not closed before the end of the |
| 174 | stream or the next token was encountered. |
| 175 | </dd></dl> |
| 176 | |
| 177 | <P> |
| 178 | <dl><dt><b><tt>XML_ERROR_UNDEFINED_ENTITY</tt></b></dt> |
| 179 | <dd> |
| 180 | A reference was made to a entity which was not defined. |
| 181 | </dd></dl> |
| 182 | |
| 183 | <P> |
| 184 | <dl><dt><b><tt>XML_ERROR_UNKNOWN_ENCODING</tt></b></dt> |
| 185 | <dd> |
| 186 | The document encoding is not supported by Expat. |
| 187 | </dd></dl> |
| 188 | |
| 189 | <P> |
| 190 | <dl><dt><b><tt>XML_ERROR_UNCLOSED_CDATA_SECTION</tt></b></dt> |
| 191 | <dd> |
| 192 | A CDATA marked section was not closed. |
| 193 | </dd></dl> |
| 194 | |
| 195 | <P> |
| 196 | <dl><dt><b><tt>XML_ERROR_EXTERNAL_ENTITY_HANDLING</tt></b></dt> |
| 197 | <dd> |
| 198 | </dd></dl> |
| 199 | |
| 200 | <P> |
| 201 | <dl><dt><b><tt>XML_ERROR_NOT_STANDALONE</tt></b></dt> |
| 202 | <dd> |
| 203 | The parser determined that the document was not ``standalone'' though |
| 204 | it declared itself to be in the XML declaration, and the |
| 205 | <tt class="member">NotStandaloneHandler</tt> was set and returned <code>0</code>. |
| 206 | </dd></dl> |
| 207 | |
| 208 | <P> |
| 209 | <dl><dt><b><tt>XML_ERROR_UNEXPECTED_STATE</tt></b></dt> |
| 210 | <dd> |
| 211 | </dd></dl> |
| 212 | |
| 213 | <P> |
| 214 | <dl><dt><b><tt>XML_ERROR_ENTITY_DECLARED_IN_PE</tt></b></dt> |
| 215 | <dd> |
| 216 | </dd></dl> |
| 217 | |
| 218 | <P> |
| 219 | <dl><dt><b><tt>XML_ERROR_FEATURE_REQUIRES_XML_DTD</tt></b></dt> |
| 220 | <dd> |
| 221 | An operation was requested that requires DTD support to be compiled |
| 222 | in, but Expat was configured without DTD support. This should never |
| 223 | be reported by a standard build of the <tt class="module">xml.parsers.expat</tt> |
| 224 | module. |
| 225 | </dd></dl> |
| 226 | |
| 227 | <P> |
| 228 | <dl><dt><b><tt>XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING</tt></b></dt> |
| 229 | <dd> |
| 230 | A behavioral change was requested after parsing started that can only |
| 231 | be changed before parsing has started. This is (currently) only |
| 232 | raised by <tt class="method">UseForeignDTD()</tt>. |
| 233 | </dd></dl> |
| 234 | |
| 235 | <P> |
| 236 | <dl><dt><b><tt>XML_ERROR_UNBOUND_PREFIX</tt></b></dt> |
| 237 | <dd> |
| 238 | An undeclared prefix was found when namespace processing was enabled. |
| 239 | </dd></dl> |
| 240 | |
| 241 | <P> |
| 242 | <dl><dt><b><tt>XML_ERROR_UNDECLARING_PREFIX</tt></b></dt> |
| 243 | <dd> |
| 244 | The document attempted to remove the namespace declaration associated |
| 245 | with a prefix. |
| 246 | </dd></dl> |
| 247 | |
| 248 | <P> |
| 249 | <dl><dt><b><tt>XML_ERROR_INCOMPLETE_PE</tt></b></dt> |
| 250 | <dd> |
| 251 | A parameter entity contained incomplete markup. |
| 252 | </dd></dl> |
| 253 | |
| 254 | <P> |
| 255 | <dl><dt><b><tt>XML_ERROR_XML_DECL</tt></b></dt> |
| 256 | <dd> |
| 257 | The document contained no document element at all. |
| 258 | </dd></dl> |
| 259 | |
| 260 | <P> |
| 261 | <dl><dt><b><tt>XML_ERROR_TEXT_DECL</tt></b></dt> |
| 262 | <dd> |
| 263 | There was an error parsing a text declaration in an external entity. |
| 264 | </dd></dl> |
| 265 | |
| 266 | <P> |
| 267 | <dl><dt><b><tt>XML_ERROR_PUBLICID</tt></b></dt> |
| 268 | <dd> |
| 269 | Characters were found in the public id that are not allowed. |
| 270 | </dd></dl> |
| 271 | |
| 272 | <P> |
| 273 | <dl><dt><b><tt>XML_ERROR_SUSPENDED</tt></b></dt> |
| 274 | <dd> |
| 275 | The requested operation was made on a suspended parser, but isn't |
| 276 | allowed. This includes attempts to provide additional input or to |
| 277 | stop the parser. |
| 278 | </dd></dl> |
| 279 | |
| 280 | <P> |
| 281 | <dl><dt><b><tt>XML_ERROR_NOT_SUSPENDED</tt></b></dt> |
| 282 | <dd> |
| 283 | An attempt to resume the parser was made when the parser had not been |
| 284 | suspended. |
| 285 | </dd></dl> |
| 286 | |
| 287 | <P> |
| 288 | <dl><dt><b><tt>XML_ERROR_ABORTED</tt></b></dt> |
| 289 | <dd> |
| 290 | This should not be reported to Python applications. |
| 291 | </dd></dl> |
| 292 | |
| 293 | <P> |
| 294 | <dl><dt><b><tt>XML_ERROR_FINISHED</tt></b></dt> |
| 295 | <dd> |
| 296 | The requested operation was made on a parser which was finished |
| 297 | parsing input, but isn't allowed. This includes attempts to provide |
| 298 | additional input or to stop the parser. |
| 299 | </dd></dl> |
| 300 | |
| 301 | <P> |
| 302 | <dl><dt><b><tt>XML_ERROR_SUSPEND_PE</tt></b></dt> |
| 303 | <dd> |
| 304 | </dd></dl> |
| 305 | |
| 306 | <DIV CLASS="navigation"> |
| 307 | <div class='online-navigation'> |
| 308 | <p></p><hr /> |
| 309 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 310 | <tr> |
| 311 | <td class='online-navigation'><a rel="prev" title="13.5.4 Content Model Descriptions" |
| 312 | href="expat-content-models.html"><img src='../icons/previous.png' |
| 313 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 314 | <td class='online-navigation'><a rel="parent" title="13.5 xml.parsers.expat " |
| 315 | href="module-xml.parsers.expat.html"><img src='../icons/up.png' |
| 316 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 317 | <td class='online-navigation'><a rel="next" title="13.6 xml.dom " |
| 318 | href="module-xml.dom.html"><img src='../icons/next.png' |
| 319 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 320 | <td align="center" width="100%">Python Library Reference</td> |
| 321 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 322 | href="contents.html"><img src='../icons/contents.png' |
| 323 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 324 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 325 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 326 | <td class='online-navigation'><a rel="index" title="Index" |
| 327 | href="genindex.html"><img src='../icons/index.png' |
| 328 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 329 | </tr></table> |
| 330 | <div class='online-navigation'> |
| 331 | <b class="navlabel">Previous:</b> |
| 332 | <a class="sectref" rel="prev" href="expat-content-models.html">13.5.4 Content Model Descriptions</A> |
| 333 | <b class="navlabel">Up:</b> |
| 334 | <a class="sectref" rel="parent" href="module-xml.parsers.expat.html">13.5 xml.parsers.expat </A> |
| 335 | <b class="navlabel">Next:</b> |
| 336 | <a class="sectref" rel="next" href="module-xml.dom.html">13.6 xml.dom </A> |
| 337 | </div> |
| 338 | </div> |
| 339 | <hr /> |
| 340 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 341 | </DIV> |
| 342 | <!--End of Navigation Panel--> |
| 343 | <ADDRESS> |
| 344 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 345 | </ADDRESS> |
| 346 | </BODY> |
| 347 | </HTML> |