summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-06-08 14:47:46 (GMT)
committerGitHub <noreply@github.com>2020-06-08 14:47:46 (GMT)
commit1220a4707966679d15a9b5f7596ddd06bb4d5f23 (patch)
treece02bc7d2342f76aa400c341bf47b95f14eedb23
parent60edee8adb4133cd277f2955062ad36d49e6debf (diff)
downloadcpython-1220a4707966679d15a9b5f7596ddd06bb4d5f23.zip
cpython-1220a4707966679d15a9b5f7596ddd06bb4d5f23.tar.gz
cpython-1220a4707966679d15a9b5f7596ddd06bb4d5f23.tar.bz2
bpo-33187: Document 3.9 changes to xml.etree.ElementInclude.include (GH-20438)
Looks like the merging of bpo-33187 and bpo-20928 was racy, resulting in this change going undocumented. (cherry picked from commit 301f0d4ff9b6bd60599eea0612904f65a92e6dd9) Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
-rw-r--r--Doc/library/xml.etree.elementtree.rst13
1 files changed, 11 insertions, 2 deletions
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index 658bc3a..2085a85 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -816,16 +816,25 @@ Functions
loader fails, it can return None or raise an exception.
-.. function:: xml.etree.ElementInclude.include( elem, loader=None)
+.. function:: xml.etree.ElementInclude.include( elem, loader=None, base_url=None, \
+ max_depth=6)
This function expands XInclude directives. *elem* is the root element. *loader* is
an optional resource loader. If omitted, it defaults to :func:`default_loader`.
If given, it should be a callable that implements the same interface as
- :func:`default_loader`. Returns the expanded resource. If the parse mode is
+ :func:`default_loader`. *base_url* is base URL of the original file, to resolve
+ relative include file references. *max_depth* is the maximum number of recursive
+ inclusions. Limited to reduce the risk of malicious content explosion. Pass a
+ negative value to disable the limitation.
+
+ Returns the expanded resource. If the parse mode is
``"xml"``, this is an ElementTree instance. If the parse mode is "text",
this is a Unicode string. If the loader fails, it can return None or
raise an exception.
+ .. versionadded:: 3.9
+ The *base_url* and *max_depth* parameters.
+
.. _elementtree-element-objects: