]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added a footnote to each pointing out that for XML output if an encoding
authorMark Summerfield <list@qtrac.plus.com>
Mon, 17 Mar 2008 08:28:15 +0000 (08:28 +0000)
committerMark Summerfield <list@qtrac.plus.com>
Mon, 17 Mar 2008 08:28:15 +0000 (08:28 +0000)
string is given it should conform to the appropriate XML standards---for
example, "UTF-8" is okay, but "UTF8" is not.

Doc/library/pyexpat.rst
Doc/library/xml.dom.minidom.rst
Doc/library/xml.etree.elementtree.rst

index 9a0f9140408dbd7639e8f95da30ad146eed23edb..1d5e6e6983e876699841f904e204cc9a20d716a9 100644 (file)
@@ -63,7 +63,7 @@ The :mod:`xml.parsers.expat` module contains two functions:
    must be a string naming the encoding  used by the XML data.  Expat doesn't
    support as many encodings as Python does, and its repertoire of encodings can't
    be extended; it supports UTF-8, UTF-16, ISO-8859-1 (Latin1), and ASCII.  If
-   *encoding* is given it will override the implicit or explicit encoding of the
+   *encoding* [1]_ is given it will override the implicit or explicit encoding of the
    document.
 
    Expat can optionally do XML namespace processing for you, enabled by providing a
@@ -885,3 +885,11 @@ The ``errors`` object has the following attributes:
 .. data:: XML_ERROR_SUSPEND_PE
    :noindex:
 
+
+.. rubric:: Footnotes
+
+.. [#] 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 .
+
index 3f1d2a4b925b906e2ad30b7c5082fa0460cc084d..21b2d6cb61f10cdf807508bf14efd5f31a42dc98 100644 (file)
@@ -141,7 +141,8 @@ module documentation.  This section lists the differences between the API and
       support pretty output.
 
    .. versionchanged:: 2.3
-      For the :class:`Document` node, an additional keyword argument *encoding* can be
+      For the :class:`Document` node, an additional keyword argument
+      *encoding* [1]_ can be
       used to specify the encoding field of the XML header.
 
 
@@ -154,7 +155,7 @@ module documentation.  This section lists the differences between the API and
    document. Encoding this string in an encoding other than UTF-8 is likely
    incorrect, since UTF-8 is the default encoding of XML.
 
-   With an explicit *encoding* argument, the result is a byte string in the
+   With an explicit *encoding* [1]_ argument, the result is a byte string in the
    specified encoding. It is recommended that this argument is always specified. To
    avoid :exc:`UnicodeError` exceptions in case of unrepresentable text data, the
    encoding argument should be specified as "utf-8".
@@ -172,7 +173,7 @@ module documentation.  This section lists the differences between the API and
    .. versionadded:: 2.1
 
    .. versionchanged:: 2.3
-      the encoding argument; see :meth:`toxml`.
+      the encoding [1]_ argument; see :meth:`toxml`.
 
 The following standard DOM methods have special considerations with
 :mod:`xml.dom.minidom`:
@@ -265,3 +266,9 @@ The following interfaces have no implementation in :mod:`xml.dom.minidom`:
 Most of these reflect information in the XML document that is not of general
 utility to most DOM users.
 
+.. rubric:: Footnotes
+
+.. [#] 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 .
index d1d4b6b3938be90e06b832084d9632d0b9db4e06..e0b995552fbb2ed2a56145a8270c09b4fdc0964a 100644 (file)
@@ -357,7 +357,7 @@ ElementTree Objects
 .. method:: ElementTree.write(file[, encoding])
 
    Writes the element tree to a file, as XML. *file* is a file name, or a file
-   object opened for writing. *encoding* is the output encoding (default is
+   object opened for writing. *encoding* [1]_ is the output encoding (default is
    US-ASCII).
 
 This is the XML file that is going to be manipulated::
@@ -510,3 +510,12 @@ This is an example of counting the maximum depth of an XML file::
     >>> parser.feed(exampleXml)
     >>> parser.close()
     4
+
+
+.. rubric:: Footnotes
+
+.. [#] 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 .
+