Skip to content

[3.9] bpo-33187: Document 3.9 changes to xml.etree.ElementInclude.include (GH-20438) #20722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Doc/library/xml.etree.elementtree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down