bpo-37534: Allow adding Standalone Document Declaration when generating XML documents (GH-14912)
diff --git a/Doc/library/xml.dom.minidom.rst b/Doc/library/xml.dom.minidom.rst
index 8711242..2c78cd9 100644
--- a/Doc/library/xml.dom.minidom.rst
+++ b/Doc/library/xml.dom.minidom.rst
@@ -132,7 +132,8 @@
... # Work with dom.
-.. method:: Node.writexml(writer, indent="", addindent="", newl="")
+.. method:: Node.writexml(writer, indent="", addindent="", newl="",
+ encoding=None, standalone=None)
Write XML to the writer object. The writer receives texts but not bytes as input,
it should have a :meth:`write` method which matches that of the file object
@@ -144,11 +145,18 @@
For the :class:`Document` node, an additional keyword argument *encoding* can
be used to specify the encoding field of the XML header.
+ Silimarly, explicitly stating the *standalone* argument causes the
+ standalone document declarations to be added to the prologue of the XML
+ document.
+ If the value is set to `True`, `standalone="yes"` is added,
+ otherwise it is set to `"no"`.
+ Not stating the argument will omit the declaration from the document.
+
.. versionchanged:: 3.8
The :meth:`writexml` method now preserves the attribute order specified
by the user.
-.. method:: Node.toxml(encoding=None)
+.. method:: Node.toxml(encoding=None, standalone=None)
Return a string or byte string containing the XML represented by
the DOM node.
@@ -160,11 +168,14 @@
encoding. Encoding this string in an encoding other than UTF-8 is
likely incorrect, since UTF-8 is the default encoding of XML.
+ The *standalone* argument behaves exactly as in :meth:`writexml`.
+
.. versionchanged:: 3.8
The :meth:`toxml` method now preserves the attribute order specified
by the user.
-.. method:: Node.toprettyxml(indent="\\t", newl="\\n", encoding=None)
+.. method:: Node.toprettyxml(indent="\\t", newl="\\n", encoding=None,
+ standalone=None)
Return a pretty-printed version of the document. *indent* specifies the
indentation string and defaults to a tabulator; *newl* specifies the string
@@ -173,6 +184,8 @@
The *encoding* argument behaves like the corresponding argument of
:meth:`toxml`.
+ The *standalone* argument behaves exactly as in :meth:`writexml`.
+
.. versionchanged:: 3.8
The :meth:`toprettyxml` method now preserves the attribute order specified
by the user.