GeezerVison is showing github.com — gh-156388: Docs: clarify DocumentType identifiers by Neiland85 · Pull Request #157646 · python/cpython
Conversation
Neiland85
commented
Sep 16, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Refs #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.
This covers only the publicId/systemId mapping. Other remaining items in #156388 are out of scope.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Neiland85
changed the title
Docs: clarify DocumentType identifiers
gh-156388: Docs: clarify DocumentType identifiers
Sep 16, 2026
|
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-None → PUBLIC
publicId is None, systemId non-None → SYSTEM
- 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Hi, just following up on this documentation PR. It clarifies the DocumentType.publicId / systemId combinations for parsed XML documents and notes the behavior of createDocumentType() for programmatically created objects.
The documentation preview is available, and I’m happy to revise the wording if anything needs clarification. Thanks for your time.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.