<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
<link rel=
"STYLESHEET" href=
"lib.css" type='text/css'
/>
<link rel=
"SHORTCUT ICON" href=
"../icons/pyfav.png" type=
"image/png" />
<link rel='start' href='../index.html' title='Python Documentation Index'
/>
<link rel=
"first" href=
"lib.html" title='Python Library Reference'
/>
<link rel='contents' href='contents.html'
title=
"Contents" />
<link rel='index' href='genindex.html' title='Index'
/>
<link rel='last' href='about.html' title='About this document...'
/>
<link rel='help' href='about.html' title='About this document...'
/>
<link rel=
"prev" href=
"expat-content-models.html" />
<link rel=
"parent" href=
"module-xml.parsers.expat.html" />
<link rel=
"next" href=
"module-xml.dom.html" />
<meta name='aesop' content='information'
/>
<title>13.5.5 Expat error constants
</title>
<div id='top-navigation-panel' xml:id='top-navigation-panel'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<td class='online-navigation'
><a rel=
"prev" title=
"13.5.4 Content Model Descriptions"
href=
"expat-content-models.html"><img src='../icons/previous.png'
border='
0' height='
32' alt='Previous Page' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"parent" title=
"13.5 xml.parsers.expat "
href=
"module-xml.parsers.expat.html"><img src='../icons/up.png'
border='
0' height='
32' alt='Up One Level' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"next" title=
"13.6 xml.dom "
href=
"module-xml.dom.html"><img src='../icons/next.png'
border='
0' height='
32' alt='Next Page' width='
32'
/></A></td>
<td align=
"center" width=
"100%">Python Library Reference
</td>
<td class='online-navigation'
><a rel=
"contents" title=
"Table of Contents"
href=
"contents.html"><img src='../icons/contents.png'
border='
0' height='
32' alt='Contents' width='
32'
/></A></td>
<td class='online-navigation'
><a href=
"modindex.html" title=
"Module Index"><img src='../icons/modules.png'
border='
0' height='
32' alt='Module Index' width='
32'
/></a></td>
<td class='online-navigation'
><a rel=
"index" title=
"Index"
href=
"genindex.html"><img src='../icons/index.png'
border='
0' height='
32' alt='Index' width='
32'
/></A></td>
<div class='online-navigation'
>
<b class=
"navlabel">Previous:
</b>
<a class=
"sectref" rel=
"prev" href=
"expat-content-models.html">13.5.4 Content Model Descriptions
</A>
<b class=
"navlabel">Up:
</b>
<a class=
"sectref" rel=
"parent" href=
"module-xml.parsers.expat.html">13.5 xml.parsers.expat
</A>
<b class=
"navlabel">Next:
</b>
<a class=
"sectref" rel=
"next" href=
"module-xml.dom.html">13.6 xml.dom
</A>
<!--End of Navigation Panel-->
<H2><A NAME=
"SECTION0015550000000000000000"></A><A NAME=
"expat-errors"></A>
13.5.5 Expat error constants
The following constants are provided in the
<code>errors
</code> object of
the
<tt class=
"module"><a href=
"module-xml.parsers.expat.html">xml.parsers.expat
</a></tt> module. These constants are useful
in interpreting some of the attributes of the
<tt class=
"exception">ExpatError
</tt>
exception objects raised when an error has occurred.
The
<code>errors
</code> object has the following attributes:
<dl><dt><b><tt>XML_ERROR_ASYNC_ENTITY
</tt></b></dt>
<dl><dt><b><tt>XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF
</tt></b></dt>
An entity reference in an attribute value referred to an external
entity instead of an internal entity.
<dl><dt><b><tt>XML_ERROR_BAD_CHAR_REF
</tt></b></dt>
A character reference referred to a character which is illegal in XML
(for example, character
<code>0</code>, or `
<code>&#
0;
</code>').
<dl><dt><b><tt>XML_ERROR_BINARY_ENTITY_REF
</tt></b></dt>
An entity reference referred to an entity which was declared with a
notation, so cannot be parsed.
<dl><dt><b><tt>XML_ERROR_DUPLICATE_ATTRIBUTE
</tt></b></dt>
An attribute was used more than once in a start tag.
<dl><dt><b><tt>XML_ERROR_INCORRECT_ENCODING
</tt></b></dt>
<dl><dt><b><tt>XML_ERROR_INVALID_TOKEN
</tt></b></dt>
Raised when an input byte could not properly be assigned to a
character; for example, a NUL byte (value
<code>0</code>) in a UTF-
8 input
<dl><dt><b><tt>XML_ERROR_JUNK_AFTER_DOC_ELEMENT
</tt></b></dt>
Something other than whitespace occurred after the document element.
<dl><dt><b><tt>XML_ERROR_MISPLACED_XML_PI
</tt></b></dt>
An XML declaration was found somewhere other than the start of the
<dl><dt><b><tt>XML_ERROR_NO_ELEMENTS
</tt></b></dt>
The document contains no elements (XML requires all documents to
contain exactly one top-level element)..
<dl><dt><b><tt>XML_ERROR_NO_MEMORY
</tt></b></dt>
Expat was not able to allocate memory internally.
<dl><dt><b><tt>XML_ERROR_PARAM_ENTITY_REF
</tt></b></dt>
A parameter entity reference was found where it was not allowed.
<dl><dt><b><tt>XML_ERROR_PARTIAL_CHAR
</tt></b></dt>
An incomplete character was found in the input.
<dl><dt><b><tt>XML_ERROR_RECURSIVE_ENTITY_REF
</tt></b></dt>
An entity reference contained another reference to the same entity;
possibly via a different name, and possibly indirectly.
<dl><dt><b><tt>XML_ERROR_SYNTAX
</tt></b></dt>
Some unspecified syntax error was encountered.
<dl><dt><b><tt>XML_ERROR_TAG_MISMATCH
</tt></b></dt>
An end tag did not match the innermost open start tag.
<dl><dt><b><tt>XML_ERROR_UNCLOSED_TOKEN
</tt></b></dt>
Some token (such as a start tag) was not closed before the end of the
stream or the next token was encountered.
<dl><dt><b><tt>XML_ERROR_UNDEFINED_ENTITY
</tt></b></dt>
A reference was made to a entity which was not defined.
<dl><dt><b><tt>XML_ERROR_UNKNOWN_ENCODING
</tt></b></dt>
The document encoding is not supported by Expat.
<dl><dt><b><tt>XML_ERROR_UNCLOSED_CDATA_SECTION
</tt></b></dt>
A CDATA marked section was not closed.
<dl><dt><b><tt>XML_ERROR_EXTERNAL_ENTITY_HANDLING
</tt></b></dt>
<dl><dt><b><tt>XML_ERROR_NOT_STANDALONE
</tt></b></dt>
The parser determined that the document was not ``standalone'' though
it declared itself to be in the XML declaration, and the
<tt class=
"member">NotStandaloneHandler
</tt> was set and returned
<code>0</code>.
<dl><dt><b><tt>XML_ERROR_UNEXPECTED_STATE
</tt></b></dt>
<dl><dt><b><tt>XML_ERROR_ENTITY_DECLARED_IN_PE
</tt></b></dt>
<dl><dt><b><tt>XML_ERROR_FEATURE_REQUIRES_XML_DTD
</tt></b></dt>
An operation was requested that requires DTD support to be compiled
in, but Expat was configured without DTD support. This should never
be reported by a standard build of the
<tt class=
"module">xml.parsers.expat
</tt>
<dl><dt><b><tt>XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
</tt></b></dt>
A behavioral change was requested after parsing started that can only
be changed before parsing has started. This is (currently) only
raised by
<tt class=
"method">UseForeignDTD()
</tt>.
<dl><dt><b><tt>XML_ERROR_UNBOUND_PREFIX
</tt></b></dt>
An undeclared prefix was found when namespace processing was enabled.
<dl><dt><b><tt>XML_ERROR_UNDECLARING_PREFIX
</tt></b></dt>
The document attempted to remove the namespace declaration associated
<dl><dt><b><tt>XML_ERROR_INCOMPLETE_PE
</tt></b></dt>
A parameter entity contained incomplete markup.
<dl><dt><b><tt>XML_ERROR_XML_DECL
</tt></b></dt>
The document contained no document element at all.
<dl><dt><b><tt>XML_ERROR_TEXT_DECL
</tt></b></dt>
There was an error parsing a text declaration in an external entity.
<dl><dt><b><tt>XML_ERROR_PUBLICID
</tt></b></dt>
Characters were found in the public id that are not allowed.
<dl><dt><b><tt>XML_ERROR_SUSPENDED
</tt></b></dt>
The requested operation was made on a suspended parser, but isn't
allowed. This includes attempts to provide additional input or to
<dl><dt><b><tt>XML_ERROR_NOT_SUSPENDED
</tt></b></dt>
An attempt to resume the parser was made when the parser had not been
<dl><dt><b><tt>XML_ERROR_ABORTED
</tt></b></dt>
This should not be reported to Python applications.
<dl><dt><b><tt>XML_ERROR_FINISHED
</tt></b></dt>
The requested operation was made on a parser which was finished
parsing input, but isn't allowed. This includes attempts to provide
additional input or to stop the parser.
<dl><dt><b><tt>XML_ERROR_SUSPEND_PE
</tt></b></dt>
<div class='online-navigation'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<td class='online-navigation'
><a rel=
"prev" title=
"13.5.4 Content Model Descriptions"
href=
"expat-content-models.html"><img src='../icons/previous.png'
border='
0' height='
32' alt='Previous Page' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"parent" title=
"13.5 xml.parsers.expat "
href=
"module-xml.parsers.expat.html"><img src='../icons/up.png'
border='
0' height='
32' alt='Up One Level' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"next" title=
"13.6 xml.dom "
href=
"module-xml.dom.html"><img src='../icons/next.png'
border='
0' height='
32' alt='Next Page' width='
32'
/></A></td>
<td align=
"center" width=
"100%">Python Library Reference
</td>
<td class='online-navigation'
><a rel=
"contents" title=
"Table of Contents"
href=
"contents.html"><img src='../icons/contents.png'
border='
0' height='
32' alt='Contents' width='
32'
/></A></td>
<td class='online-navigation'
><a href=
"modindex.html" title=
"Module Index"><img src='../icons/modules.png'
border='
0' height='
32' alt='Module Index' width='
32'
/></a></td>
<td class='online-navigation'
><a rel=
"index" title=
"Index"
href=
"genindex.html"><img src='../icons/index.png'
border='
0' height='
32' alt='Index' width='
32'
/></A></td>
<div class='online-navigation'
>
<b class=
"navlabel">Previous:
</b>
<a class=
"sectref" rel=
"prev" href=
"expat-content-models.html">13.5.4 Content Model Descriptions
</A>
<b class=
"navlabel">Up:
</b>
<a class=
"sectref" rel=
"parent" href=
"module-xml.parsers.expat.html">13.5 xml.parsers.expat
</A>
<b class=
"navlabel">Next:
</b>
<a class=
"sectref" rel=
"next" href=
"module-xml.dom.html">13.6 xml.dom
</A>
<span class=
"release-info">Release
2.4.2, documentation updated on
28 September
2005.
</span>
<!--End of Navigation Panel-->
See
<i><a href=
"about.html">About this document...
</a></i> for information on suggesting changes.