GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — gh-44871: Improve DOM Level 1 conformance of xml.dom.minidom by serhiy-storchaka · Pull Request #155641 · python/cpython Conversation
|
Documentation build overview
59 files changed ·
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
A node without children cannot be an ancestor, so testing this first keeps appending leaf nodes linear in the depth of the tree. Also fix references which do not resolve on main.
The documented module is xml.parsers.expat, there is no target for pyexpat.
…nd NEWS Suggested by dgelessus in the review of pythonGH-155632, where the same wording was used.
A document can have only one element child and only one document type child. This was only checked in Document.appendChild(), and only for elements, so insertBefore() and replaceChild() could add a second one. A document fragment no longer accepts notation children, which the DOM does not allow.
It now reports whether the attribute was given in the start tag.
The DOM requires it if the attribute was created by another document. Only insertion of child nodes was checked.
It is the same interface as Element.setAttributeNode(), so it now raises WrongDocumentErr for an attribute created by another document and InuseAttributeErr for an attribute which belongs to another element.
It is minidom specific, so document it in the minidom documentation.
The DOM requires InvalidCharacterErr for an invalid XML name, WrongDocumentErr for a node created by another document, and HierarchyRequestErr for making a node a descendant of itself. None of this was documented.
The DOM does not allow Element.removeAttribute() and removeAttributeNS() to raise NotFoundErr in this case, it is a deviation of minidom, documented in pythonGH-156636.
There was an error while loading. Please reload this page.
…ython#155641) * The factory methods now raise InvalidCharacterErr if the name is not a valid XML name. * Inserting or setting a node created by another document now raises WrongDocumentErr. * Setting an attribute node which belongs to another element now raises InuseAttributeErr. * Inserting a node into itself or its descendant now raises HierarchyRequestErr. * A document can have only one element child and only one document type child, and a document fragment can no longer have notation children. * Removing an absent attribute now has no effect instead of raising NotFoundErr. * Attributes defaulted in the DTD are no longer omitted when parsing, and Attr.specified now reports whether the attribute was given in the start tag. This needs the new pyexpat method GetSpecifiedAttributeCount(). * EntityReference nodes and Document.createEntityReference() are now implemented. * The exceptions required by the DOM are now documented, and minidom specific differences are described in the minidom documentation. Co-authored-by: Jason Orendorff <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.