Kaydet (Commit) 323a43af authored tarafından Eli Bendersky's avatar Eli Bendersky

Issue #12322: clarify xpath reference for cases where the path reaches ancestors…

Issue #12322: clarify xpath reference for cases where the path reaches ancestors of the start element. Also add missing markup for a None. Thanks to patrick vrijlandt and Mike Hoy for the report and initial patches.
üst ea69bd3c
...@@ -291,7 +291,9 @@ Supported XPath syntax ...@@ -291,7 +291,9 @@ Supported XPath syntax
| | current element. For example, ``.//egg`` selects | | | current element. For example, ``.//egg`` selects |
| | all ``egg`` elements in the entire tree. | | | all ``egg`` elements in the entire tree. |
+-----------------------+------------------------------------------------------+ +-----------------------+------------------------------------------------------+
| ``..`` | Selects the parent element. | | ``..`` | Selects the parent element. Returns ``None`` if the |
| | path attempts to reach the ancestors of the start |
| | element (the element ``find`` was called on). |
+-----------------------+------------------------------------------------------+ +-----------------------+------------------------------------------------------+
| ``[@attrib]`` | Selects all elements that have the given attribute. | | ``[@attrib]`` | Selects all elements that have the given attribute. |
+-----------------------+------------------------------------------------------+ +-----------------------+------------------------------------------------------+
...@@ -521,7 +523,7 @@ Element Objects ...@@ -521,7 +523,7 @@ Element Objects
.. method:: clear() .. method:: clear()
Resets an element. This function removes all subelements, clears all Resets an element. This function removes all subelements, clears all
attributes, and sets the text and tail attributes to None. attributes, and sets the text and tail attributes to ``None``.
.. method:: get(key, default=None) .. method:: get(key, default=None)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment