| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
It tells how many of the attributes reported to StartElementHandler were given in the start tag rather than defaulted from the DTD.
* The factory methods now raise InvalidCharacterErr if the name is not a valid XML name. * appendChild(), insertBefore() and replaceChild() now raise WrongDocumentErr if the new child was created by other document, and HierarchyRequestErr if it is the node itself or its ancestor. * 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. * EntityReference nodes and Document.createEntityReference() are now implemented.
Documentation build overview59 files changed · + 1 added · ± 58 modified + Added ± Modified |
Sorry, something went wrong.
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.
…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 <283361+jorendorff@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
Rework of minidom-level-1-compliance.4.patch by Jason Orendorff (2007), which no longer applies: it is Python 2 source (ur'' literals), and its XML 1.0 name tables predate XML 1.0 Fifth Edition, which adopted the XML 1.1 Name production.
Two parts of the original patch are not included. Document.xmlVersion existed only to select between the XML 1.0 and 1.1 name grammars, which are now identical. Making writes to nodeValue a no-op where the DOM defines it as null conflicts with #155627, which deprecates writes to read-only attributes rather than ignoring them.
Rejecting invalid names and cross-document insertions breaks code which currently succeeds, so this is documented in the porting section of What's New.