@@ -468,16 +468,18 @@ ElementTree Objects
468
468
root element.
469
469
470
470
471
- .. method :: write(file, encoding="us-ascii", xml_declaration=None, method="xml")
471
+ .. method :: write(file, encoding="us-ascii", xml_declaration=None, \
472
+ default_namespace=None, method="xml")
472
473
473
474
Writes the element tree to a file, as XML. *file * is a file name, or a
474
- :term: `file object ` opened for writing. *encoding * [1 ]_ is the output encoding
475
- (default is US-ASCII). Use ``encoding="unicode" `` to write a Unicode string.
476
- *xml_declaration * controls if an XML declaration
475
+ :term: `file object ` opened for writing. *encoding * [1 ]_ is the output
476
+ encoding (default is US-ASCII). Use ``encoding="unicode" `` to write a
477
+ Unicode string. *xml_declaration * controls if an XML declaration
477
478
should be added to the file. Use False for never, True for always, None
478
- for only if not US-ASCII or UTF-8 or Unicode (default is None). *method * is
479
- either ``"xml" ``, ``"html" `` or ``"text" `` (default is ``"xml" ``).
480
- Returns an (optionally) encoded string.
479
+ for only if not US-ASCII or UTF-8 or Unicode (default is None).
480
+ *default_namespace * sets the default XML namespace (for "xmlns").
481
+ *method * is either ``"xml" ``, ``"html" `` or ``"text" `` (default is
482
+ ``"xml" ``). Returns an (optionally) encoded string.
481
483
482
484
This is the XML file that is going to be manipulated::
483
485
0 commit comments