diff options
Diffstat (limited to 'Doc/library/pyexpat.rst')
-rw-r--r-- | Doc/library/pyexpat.rst | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Doc/library/pyexpat.rst b/Doc/library/pyexpat.rst index 420e407663..3d88d85d1c 100644 --- a/Doc/library/pyexpat.rst +++ b/Doc/library/pyexpat.rst @@ -339,8 +339,10 @@ otherwise stated. .. method:: xmlparser.StartElementHandler(name, attributes) Called for the start of every element. *name* is a string containing the - element name, and *attributes* is a dictionary mapping attribute names to their - values. + element name, and *attributes* is the element attributes. If + :attr:`ordered_attributes` is true, this is a list (see + :attr:`ordered_attributes` for a full description). Otherwise it's a + dictionary mapping names to values. .. method:: xmlparser.EndElementHandler(name) @@ -482,8 +484,8 @@ ExpatError Exceptions .. attribute:: ExpatError.code Expat's internal error number for the specific error. The - :data:`errors.messages` dictionary maps these error numbers to Expat's error - messages. For example:: + :data:`errors.messages <xml.parsers.expat.errors.messages>` dictionary maps + these error numbers to Expat's error messages. For example:: from xml.parsers.expat import ParserCreate, ExpatError, errors @@ -493,9 +495,9 @@ ExpatError Exceptions except ExpatError as err: print("Error:", errors.messages[err.code]) - The :mod:`errors` module also provides error message constants and a - dictionary :data:`~errors.codes` mapping these messages back to the error - codes, see below. + The :mod:`~xml.parsers.expat.errors` module also provides error message + constants and a dictionary :data:`~xml.parsers.expat.errors.codes` mapping + these messages back to the error codes, see below. .. attribute:: ExpatError.lineno @@ -859,5 +861,5 @@ The ``errors`` module has the following attributes: .. [#] The encoding string included in XML output should conform to the appropriate standards. For example, "UTF-8" is valid, but "UTF8" is not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl - and http://www.iana.org/assignments/character-sets . + and http://www.iana.org/assignments/character-sets\ . |