Skip to content

gh-156388: Docs: clarify DocumentType identifiers - #157646

Open
Neiland85 wants to merge 1 commit into
python:mainfrom
Neiland85:docs-xml-dom-156388
Open

Neiland85 wants to merge 1 commit into
python:mainfrom
Neiland85:docs-xml-dom-156388

Conversation

@Neiland85

@Neiland85 Neiland85 commented Sep 16, 2026

Copy link
Copy Markdown

Closes #156388

Clarify the documented relationship between DocumentType.publicId and systemId for parsed XML documents, including PUBLIC and SYSTEM declarations, and note that createDocumentType() does not validate identifier combinations for programmatically created objects.

@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news awaiting review labels Sep 16, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Sep 16, 2026
@Neiland85 Neiland85 changed the title Docs: clarify DocumentType identifiers gh-156388: Docs: clarify DocumentType identifiers Sep 16, 2026
@Neiland85

Copy link
Copy Markdown
Author

Thanks for confirming this point in the issue discussion. I’ve submitted #157646 to document that mapping explicitly.

For parsed XML documents, the combinations correspond as follows:

  • publicId and systemId non-NonePUBLIC
  • publicId is None, systemId non-NoneSYSTEM
  • both are None → no external identifier
  • publicId non-None, systemId None → not produced by parsing a valid XML DOCTYPE

I also noted in the PR that createDocumentType() does not validate the identifiers, so programmatically created DocumentType objects may have other combinations.

I’ll leave the PR open for maintainer review and follow any requested changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

xml.dom docs are missing important information necessary for usage

1 participant