summaryrefslogtreecommitdiffstats
path: root/Doc/library/xml.etree.elementtree.rst
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2019-04-14 08:09:09 (GMT)
committerGitHub <noreply@github.com>2019-04-14 08:09:09 (GMT)
commite9927e1820caea01e576141d9a623ea394d43dad (patch)
tree4f758ae025e9b5c1bb6198bb4524571da118489f /Doc/library/xml.etree.elementtree.rst
parentffca16e25a70fd44a87b13b379b5ec0c7a11e926 (diff)
downloadcpython-e9927e1820caea01e576141d9a623ea394d43dad.zip
cpython-e9927e1820caea01e576141d9a623ea394d43dad.tar.gz
cpython-e9927e1820caea01e576141d9a623ea394d43dad.tar.bz2
bpo-30485: support a default prefix mapping in ElementPath by passing None as prefix (#1823)
Diffstat (limited to 'Doc/library/xml.etree.elementtree.rst')
-rw-r--r--Doc/library/xml.etree.elementtree.rst9
1 files changed, 6 insertions, 3 deletions
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index 9bee0ea..c83e719 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -764,7 +764,8 @@ Element Objects
Finds the first subelement matching *match*. *match* may be a tag name
or a :ref:`path <elementtree-xpath>`. Returns an element instance
or ``None``. *namespaces* is an optional mapping from namespace prefix
- to full name.
+ to full name. Pass ``None`` as prefix to move all unprefixed tag names
+ in the expression into the given namespace.
.. method:: findall(match, namespaces=None)
@@ -772,7 +773,8 @@ Element Objects
Finds all matching subelements, by tag name or
:ref:`path <elementtree-xpath>`. Returns a list containing all matching
elements in document order. *namespaces* is an optional mapping from
- namespace prefix to full name.
+ namespace prefix to full name. Pass ``None`` as prefix to move all
+ unprefixed tag names in the expression into the given namespace.
.. method:: findtext(match, default=None, namespaces=None)
@@ -782,7 +784,8 @@ Element Objects
of the first matching element, or *default* if no element was found.
Note that if the matching element has no text content an empty string
is returned. *namespaces* is an optional mapping from namespace prefix
- to full name.
+ to full name. Pass ``None`` as prefix to move all unprefixed tag names
+ in the expression into the given namespace.
.. method:: getchildren()