]> granicus.if.org Git - python/commitdiff
Issue #18760: Improved cross-references in the xml package.
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 29 Aug 2013 07:34:23 +0000 (10:34 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Thu, 29 Aug 2013 07:34:23 +0000 (10:34 +0300)
Doc/library/xml.dom.minidom.rst
Doc/library/xml.dom.rst
Doc/library/xml.etree.elementtree.rst
Doc/library/xml.sax.handler.rst
Doc/library/xml.sax.reader.rst
Doc/library/xml.sax.rst
Doc/library/xml.sax.utils.rst

index 70f0c030761440027b051642d0ff01ad948a84bc..f6984a01112390cd91cc3b10fb95644762228c7b 100644 (file)
@@ -58,7 +58,7 @@ instead:
 .. function:: parseString(string[, parser])
 
    Return a :class:`Document` that represents the *string*. This method creates a
-   :class:`StringIO` object for the string and passes that on to :func:`parse`.
+   :class:`io.StringIO` object for the string and passes that on to :func:`parse`.
 
 Both functions return a :class:`Document` object representing the content of the
 document.
index 565dc84907ddfe4ad1034b762f0d2d8fc9f186ff..541d6496e18d2641426a28d6435b2327e3155969 100644 (file)
@@ -441,14 +441,15 @@ objects:
 
 In addition, the Python DOM interface requires that some additional support is
 provided to allow :class:`NodeList` objects to be used as Python sequences.  All
-:class:`NodeList` implementations must include support for :meth:`__len__` and
-:meth:`__getitem__`; this allows iteration over the :class:`NodeList` in
+:class:`NodeList` implementations must include support for
+:meth:`~object.__len__` and
+:meth:`~object.__getitem__`; this allows iteration over the :class:`NodeList` in
 :keyword:`for` statements and proper support for the :func:`len` built-in
 function.
 
 If a DOM implementation supports modification of the document, the
-:class:`NodeList` implementation must also support the :meth:`__setitem__` and
-:meth:`__delitem__` methods.
+:class:`NodeList` implementation must also support the
+:meth:`~object.__setitem__` and :meth:`~object.__delitem__` methods.
 
 
 .. _dom-documenttype-objects:
index e6ea004b577f7775e37b342f4e591d162a7853a0..fee56ff3fe961b6317e5ac71605fcd8374bdac99 100644 (file)
@@ -680,8 +680,9 @@ Element Objects
       or contents.
 
    :class:`Element` objects also support the following sequence type methods
-   for working with subelements: :meth:`__delitem__`, :meth:`__getitem__`,
-   :meth:`__setitem__`, :meth:`__len__`.
+   for working with subelements: :meth:`~object.__delitem__`,
+   :meth:`~object.__getitem__`, :meth:`~object.__setitem__`,
+   :meth:`~object.__len__`.
 
    Caution: Elements with no subelements will test as ``False``.  This behavior
    will change in future versions.  Use specific ``len(elem)`` or ``elem is
index 23f429e07323e33673269118e1ecca7bc625bc07..15140a3454922181b2f95a121f0112ab87ce25a7 100644 (file)
@@ -240,7 +240,8 @@ events in the input document:
    Signals the start of an element in non-namespace mode.
 
    The *name* parameter contains the raw XML 1.0 name of the element type as a
-   string and the *attrs* parameter holds an object of the :class:`Attributes`
+   string and the *attrs* parameter holds an object of the
+   :class:`~xml.sax.xmlreader.Attributes`
    interface (see :ref:`attributes-objects`) containing the attributes of
    the element.  The object passed as *attrs* may be re-used by the parser; holding
    on to a reference to it is not a reliable way to keep a copy of the attributes.
@@ -263,7 +264,8 @@ events in the input document:
    The *name* parameter contains the name of the element type as a ``(uri,
    localname)`` tuple, the *qname* parameter contains the raw XML 1.0 name used in
    the source document, and the *attrs* parameter holds an instance of the
-   :class:`AttributesNS` interface (see :ref:`attributes-ns-objects`)
+   :class:`~xml.sax.xmlreader.AttributesNS` interface (see
+   :ref:`attributes-ns-objects`)
    containing the attributes of the element.  If no namespace is associated with
    the element, the *uri* component of *name* will be ``None``.  The object passed
    as *attrs* may be re-used by the parser; holding on to a reference to it is not
@@ -379,8 +381,9 @@ ErrorHandler Objects
 --------------------
 
 Objects with this interface are used to receive error and warning information
-from the :class:`XMLReader`.  If you create an object that implements this
-interface, then register the object with your :class:`XMLReader`, the parser
+from the :class:`~xml.sax.xmlreader.XMLReader`.  If you create an object that
+implements this interface, then register the object with your
+:class:`~xml.sax.xmlreader.XMLReader`, the parser
 will call the methods in your object to report all warnings and errors. There
 are three levels of errors available: warnings, (possibly) recoverable errors,
 and unrecoverable errors.  All methods take a :exc:`SAXParseException` as the
index 4b3c18ac64c14f3c2ff62b95a0509a7d44ba65a8..e09ad7f811db8fa7639979800021a2efc7788d3c 100644 (file)
@@ -109,47 +109,50 @@ The :class:`XMLReader` interface supports the following methods:
 
 .. method:: XMLReader.getContentHandler()
 
-   Return the current :class:`ContentHandler`.
+   Return the current :class:`~xml.sax.handler.ContentHandler`.
 
 
 .. method:: XMLReader.setContentHandler(handler)
 
-   Set the current :class:`ContentHandler`.  If no :class:`ContentHandler` is set,
-   content events will be discarded.
+   Set the current :class:`~xml.sax.handler.ContentHandler`.  If no
+   :class:`~xml.sax.handler.ContentHandler` is set, content events will be
+   discarded.
 
 
 .. method:: XMLReader.getDTDHandler()
 
-   Return the current :class:`DTDHandler`.
+   Return the current :class:`~xml.sax.handler.DTDHandler`.
 
 
 .. method:: XMLReader.setDTDHandler(handler)
 
-   Set the current :class:`DTDHandler`.  If no :class:`DTDHandler` is set, DTD
+   Set the current :class:`~xml.sax.handler.DTDHandler`.  If no
+   :class:`~xml.sax.handler.DTDHandler` is set, DTD
    events will be discarded.
 
 
 .. method:: XMLReader.getEntityResolver()
 
-   Return the current :class:`EntityResolver`.
+   Return the current :class:`~xml.sax.handler.EntityResolver`.
 
 
 .. method:: XMLReader.setEntityResolver(handler)
 
-   Set the current :class:`EntityResolver`.  If no :class:`EntityResolver` is set,
+   Set the current :class:`~xml.sax.handler.EntityResolver`.  If no
+   :class:`~xml.sax.handler.EntityResolver` is set,
    attempts to resolve an external entity will result in opening the system
    identifier for the entity, and fail if it is not available.
 
 
 .. method:: XMLReader.getErrorHandler()
 
-   Return the current :class:`ErrorHandler`.
+   Return the current :class:`~xml.sax.handler.ErrorHandler`.
 
 
 .. method:: XMLReader.setErrorHandler(handler)
 
-   Set the current error handler.  If no :class:`ErrorHandler` is set, errors will
-   be raised as exceptions, and warnings will be printed.
+   Set the current error handler.  If no :class:`~xml.sax.handler.ErrorHandler`
+   is set, errors will be raised as exceptions, and warnings will be printed.
 
 
 .. method:: XMLReader.setLocale(locale)
@@ -326,8 +329,13 @@ The :class:`Attributes` Interface
 ---------------------------------
 
 :class:`Attributes` objects implement a portion of the mapping protocol,
-including the methods :meth:`copy`, :meth:`get`, :meth:`has_key`, :meth:`items`,
-:meth:`keys`, and :meth:`values`.  The following methods are also provided:
+including the methods :meth:`~collections.abc.Mapping.copy`,
+:meth:`~collections.abc.Mapping.get`,
+:meth:`~collections.abc.Mapping.has_key`,
+:meth:`~collections.abc.Mapping.items`,
+:meth:`~collections.abc.Mapping.keys`,
+and :meth:`~collections.abc.Mapping.values`.  The following methods
+are also provided:
 
 
 .. method:: Attributes.getLength()
index 75cfc119dde0e01e9cb3a5b18754e689e29f4617..25e4fa903246d3f7770ecc2b39b7166afcf23272 100644 (file)
@@ -29,7 +29,8 @@ The convenience functions are:
 
 .. function:: make_parser([parser_list])
 
-   Create and return a SAX :class:`XMLReader` object.  The first parser found will
+   Create and return a SAX :class:`~xml.sax.xmlreader.XMLReader` object.  The
+   first parser found will
    be used.  If *parser_list* is provided, it must be a sequence of strings which
    name modules that have a function named :func:`create_parser`.  Modules listed
    in *parser_list* will be used before modules in the default list of parsers.
@@ -39,8 +40,9 @@ The convenience functions are:
 
    Create a SAX parser and use it to parse a document.  The document, passed in as
    *filename_or_stream*, can be a filename or a file object.  The *handler*
-   parameter needs to be a SAX :class:`ContentHandler` instance.  If
-   *error_handler* is given, it must be a SAX :class:`ErrorHandler` instance; if
+   parameter needs to be a SAX :class:`~handler.ContentHandler` instance.  If
+   *error_handler* is given, it must be a SAX :class:`~handler.ErrorHandler`
+   instance; if
    omitted,  :exc:`SAXParseException` will be raised on all errors.  There is no
    return value; all work must be done by the *handler* passed in.
 
@@ -65,10 +67,12 @@ For these objects, only the interfaces are relevant; they are normally not
 instantiated by the application itself.  Since Python does not have an explicit
 notion of interface, they are formally introduced as classes, but applications
 may use implementations which do not inherit from the provided classes.  The
-:class:`InputSource`, :class:`Locator`, :class:`Attributes`,
-:class:`AttributesNS`, and :class:`XMLReader` interfaces are defined in the
+:class:`~xml.sax.xmlreader.InputSource`, :class:`~xml.sax.xmlreader.Locator`,
+:class:`~xml.sax.xmlreader.Attributes`, :class:`~xml.sax.xmlreader.AttributesNS`,
+and :class:`~xml.sax.xmlreader.XMLReader` interfaces are defined in the
 module :mod:`xml.sax.xmlreader`.  The handler interfaces are defined in
-:mod:`xml.sax.handler`.  For convenience, :class:`InputSource` (which is often
+:mod:`xml.sax.handler`.  For convenience,
+:class:`~xml.sax.xmlreader.InputSource` (which is often
 instantiated directly) and the handler classes are also available from
 :mod:`xml.sax`.  These interfaces are described below.
 
@@ -81,7 +85,8 @@ classes.
    Encapsulate an XML error or warning.  This class can contain basic error or
    warning information from either the XML parser or the application: it can be
    subclassed to provide additional functionality or to add localization.  Note
-   that although the handlers defined in the :class:`ErrorHandler` interface
+   that although the handlers defined in the
+   :class:`~xml.sax.handler.ErrorHandler` interface
    receive instances of this exception, it is not required to actually raise the
    exception --- it is also useful as a container for information.
 
@@ -94,22 +99,26 @@ classes.
 
 .. exception:: SAXParseException(msg, exception, locator)
 
-   Subclass of :exc:`SAXException` raised on parse errors. Instances of this class
-   are passed to the methods of the SAX :class:`ErrorHandler` interface to provide
-   information about the parse error.  This class supports the SAX :class:`Locator`
-   interface as well as the :class:`SAXException` interface.
+   Subclass of :exc:`SAXException` raised on parse errors. Instances of this
+   class are passed to the methods of the SAX
+   :class:`~xml.sax.handler.ErrorHandler` interface to provide information
+   about the parse error.  This class supports the SAX
+   :class:`~xml.sax.xmlreader.Locator` interface as well as the
+   :class:`SAXException` interface.
 
 
 .. exception:: SAXNotRecognizedException(msg[, exception])
 
-   Subclass of :exc:`SAXException` raised when a SAX :class:`XMLReader` is
+   Subclass of :exc:`SAXException` raised when a SAX
+   :class:`~xml.sax.xmlreader.XMLReader` is
    confronted with an unrecognized feature or property.  SAX applications and
    extensions may use this class for similar purposes.
 
 
 .. exception:: SAXNotSupportedException(msg[, exception])
 
-   Subclass of :exc:`SAXException` raised when a SAX :class:`XMLReader` is asked to
+   Subclass of :exc:`SAXException` raised when a SAX
+   :class:`~xml.sax.xmlreader.XMLReader` is asked to
    enable a feature that is not supported, or to set a property to a value that the
    implementation does not support.  SAX applications and extensions may use this
    class for similar purposes.
index c796ca8c86e958e101f2400795cba8f85b4f16b1..e774b6b8cb23744d1f010ed23a235cb9267499b8 100644 (file)
@@ -59,7 +59,8 @@ or as base classes.
 
 .. class:: XMLGenerator([out[, encoding]])
 
-   This class implements the :class:`ContentHandler` interface by writing SAX
+   This class implements the :class:`~xml.sax.handler.ContentHandler` interface
+   by writing SAX
    events back into an XML document. In other words, using an :class:`XMLGenerator`
    as the content handler will reproduce the original document being parsed. *out*
    should be a file-like object which will default to *sys.stdout*. *encoding* is
@@ -68,7 +69,8 @@ or as base classes.
 
 .. class:: XMLFilterBase(base)
 
-   This class is designed to sit between an :class:`XMLReader` and the client
+   This class is designed to sit between an
+   :class:`~xml.sax.xmlreader.XMLReader` and the client
    application's event handlers.  By default, it does nothing but pass requests up
    to the reader and events on to the handlers unmodified, but subclasses can
    override specific methods to modify the event stream or the configuration
@@ -77,9 +79,10 @@ or as base classes.
 
 .. function:: prepare_input_source(source[, base])
 
-   This function takes an input source and an optional base URL and returns a fully
-   resolved :class:`InputSource` object ready for reading.  The input source can be
-   given as a string, a file-like object, or an :class:`InputSource` object;
-   parsers will use this function to implement the polymorphic *source* argument to
-   their :meth:`parse` method.
+   This function takes an input source and an optional base URL and returns a
+   fully resolved :class:`~xml.sax.xmlreader.InputSource` object ready for
+   reading.  The input source can be given as a string, a file-like object, or
+   an :class:`~xml.sax.xmlreader.InputSource` object; parsers will use this
+   function to implement the polymorphic *source* argument to their
+   :meth:`parse` method.