FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.13] gh-156635: Fix the exceptions in the xml.dom documentation (GH-156636) by serhiy-storchaka · Pull Request #156639 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 5 additions & 0 deletions Doc/library/xml.dom.minidom.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ rules apply:
* :attr:`~xml.dom.Document.strictErrorChecking` and
:attr:`~xml.dom.Attr.specified` are always ``False``.

* :meth:`~xml.dom.Element.removeAttribute` and
:meth:`~xml.dom.Element.removeAttributeNS` raise
:exc:`~xml.dom.NotFoundErr` if there is no matching attribute,
while the DOM specifies that this has no effect.

The following interfaces have no implementation in :mod:`xml.dom.minidom`:

* :class:`DOMTimeStamp`
Expand Down
12 changes: 5 additions & 7 deletions Doc/library/xml.dom.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -464,23 +464,23 @@ for each node type are:
.. method:: Node.insertBefore(newChild, refChild)

Insert a new child node before an existing child. It must be the case that
*refChild* is a child of this node; if not, :exc:`ValueError` is raised.
*refChild* is a child of this node; if not, :exc:`NotFoundErr` is raised.
*newChild* is returned. If *refChild* is ``None``, it inserts *newChild* at the
end of the children's list.


.. method:: Node.removeChild(oldChild)

Remove a child node. *oldChild* must be a child of this node; if not,
:exc:`ValueError` is raised. *oldChild* is returned on success. If *oldChild*
:exc:`NotFoundErr` is raised. *oldChild* is returned on success. If *oldChild*
will not be used further, its :meth:`~xml.dom.minidom.Node.unlink` method
should be called.


.. method:: Node.replaceChild(newChild, oldChild)

Replace an existing node with a new node. It must be the case that *oldChild*
is a child of this node; if not, :exc:`ValueError` is raised.
is a child of this node; if not, :exc:`NotFoundErr` is raised.


.. method:: Node.normalize()
Expand Down Expand Up @@ -829,8 +829,7 @@ of that class.

.. method:: Element.removeAttribute(name)

Remove an attribute by name. If there is no matching attribute, a
:exc:`NotFoundErr` is raised.
Remove an attribute by name.


.. method:: Element.removeAttributeNode(oldAttr)
Expand All @@ -841,8 +840,7 @@ of that class.

.. method:: Element.removeAttributeNS(namespaceURI, localName)

Remove an attribute by name. Note that it uses a localName, not a qname. No
exception is raised if there is no matching attribute.
Remove an attribute by name. Note that it uses a localName, not a qname.


.. method:: Element.setAttribute(name, value)
Expand Down
Loading

Back | FazBrowse Home | New Git URL