Skip to content

Commit 453e0c7

Browse files
authored
Merge pull request #10100 from tk0miya/9413_xml_namespace
Fix #9413: xml: Invalid XML was generated when cross referencing python objects
2 parents d82d370 + 76c9b3c commit 453e0c7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Bugs fixed
7676
* #10015: py domain: types under the "typing" module are not hyperlinked defined
7777
at info-field-list
7878
* #9390: texinfo: Do not emit labels inside footnotes
79+
* #9413: xml: Invalid XML was generated when cross referencing python objects
7980
* #9979: Error level messages were displayed as warning messages
8081
* #10057: Failed to scan documents if the project is placed onto the root
8182
directory

sphinx/builders/xml.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def write_doc(self, docname: str, doctree: Node) -> None:
7171
# work around multiple string % tuple issues in docutils;
7272
# replace tuples in attribute values with lists
7373
doctree = doctree.deepcopy()
74+
for domain in self.env.domains.values():
75+
xmlns = "xmlns:" + domain.name
76+
doctree[xmlns] = "https://www.sphinx-doc.org/" # type: ignore
7477
for node in doctree.findall(nodes.Element):
7578
for att, value in node.attributes.items():
7679
if isinstance(value, tuple):

0 commit comments

Comments
 (0)