mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-40624: Add support for the XPath != operator in xml.etree (GH-22147)
This commit is contained in:
parent
4eb41d055e
commit
97e8b1eaea
4 changed files with 78 additions and 7 deletions
|
@ -455,6 +455,12 @@ Supported XPath syntax
|
|||
| | has the given value. The value cannot contain |
|
||||
| | quotes. |
|
||||
+-----------------------+------------------------------------------------------+
|
||||
| ``[@attrib!='value']``| Selects all elements for which the given attribute |
|
||||
| | does not have the given value. The value cannot |
|
||||
| | contain quotes. |
|
||||
| | |
|
||||
| | .. versionadded:: 3.10 |
|
||||
+-----------------------+------------------------------------------------------+
|
||||
| ``[tag]`` | Selects all elements that have a child named |
|
||||
| | ``tag``. Only immediate children are supported. |
|
||||
+-----------------------+------------------------------------------------------+
|
||||
|
@ -463,10 +469,22 @@ Supported XPath syntax
|
|||
| | |
|
||||
| | .. versionadded:: 3.7 |
|
||||
+-----------------------+------------------------------------------------------+
|
||||
| ``[.!='text']`` | Selects all elements whose complete text content, |
|
||||
| | including descendants, does not equal the given |
|
||||
| | ``text``. |
|
||||
| | |
|
||||
| | .. versionadded:: 3.10 |
|
||||
+-----------------------+------------------------------------------------------+
|
||||
| ``[tag='text']`` | Selects all elements that have a child named |
|
||||
| | ``tag`` whose complete text content, including |
|
||||
| | descendants, equals the given ``text``. |
|
||||
+-----------------------+------------------------------------------------------+
|
||||
| ``[tag!='text']`` | Selects all elements that have a child named |
|
||||
| | ``tag`` whose complete text content, including |
|
||||
| | descendants, does not equal the given ``text``. |
|
||||
| | |
|
||||
| | .. versionadded:: 3.10 |
|
||||
+-----------------------+------------------------------------------------------+
|
||||
| ``[position]`` | Selects all elements that are located at the given |
|
||||
| | position. The position can be either an integer |
|
||||
| | (1 is the first position), the expression ``last()`` |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue