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

gh-54092: Implement writexml() for DocumentFragment in xml.dom.minidom by serhiy-storchaka · Pull Request #156646 · python/cpython · GitHub

Repository navigation

gh-54092: Implement writexml() for DocumentFragment in xml.dom.minidom - #156646

Merged
serhiy-storchaka merged 4 commits into
python:mainfrom
serhiy-storchaka:gh-54092-fragment-writexml
Sep 13, 2026
Merged

serhiy-storchaka merged 4 commits into
python:mainfrom
serhiy-storchaka:gh-54092-fragment-writexml

Conversation

serhiy-storchaka commented Aug 30, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

DocumentFragment was the only serializable node type without a writexml() method, so toxml() and toprettyxml() failed with AttributeError for document fragments. It was documented as implemented since GH-12677.

The fragment writes its children at the current indentation, without adding a level of indentation for itself, as it has no tag.

…minidom

toxml() and toprettyxml() now work for document fragments.  They write
the children of the fragment, without adding a level of indentation.

read-the-docs-community Bot commented Aug 30, 2026 •
edited
Loading

Copy link
Copy Markdown

serhiy-storchaka enabled auto-merge (squash) September 13, 2026 14:59
…ment-writexml

# Conflicts:
#	Doc/library/xml.dom.minidom.rst
#	Doc/whatsnew/3.16.rst
#	Lib/test/test_minidom.py
serhiy-storchaka merged commit 9bd9c74 into python:main Sep 13, 2026
54 checks passed
johnslavik pushed a commit to johnslavik/cpython that referenced this pull request Sep 14, 2026
…minidom (pythonGH-156646)

toxml() and toprettyxml() now work for document fragments.  They write
the children of the fragment, without adding a level of indentation.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL