Issue #18758: Fixed and improved cross-references.
diff --git a/Doc/library/pyexpat.rst b/Doc/library/pyexpat.rst
index e3b7917..b1543d8 100644
--- a/Doc/library/pyexpat.rst
+++ b/Doc/library/pyexpat.rst
@@ -484,8 +484,8 @@
 .. 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
 
@@ -495,9 +495,9 @@
       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