Skip to content

Commit

Permalink
Merge pull request #10100 from tk0miya/9413_xml_namespace
Browse files Browse the repository at this point in the history
Fix #9413: xml: Invalid XML was generated when cross referencing python objects
  • Loading branch information
tk0miya committed Jan 15, 2022
2 parents d82d370 + 76c9b3c commit 453e0c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -76,6 +76,7 @@ Bugs fixed
* #10015: py domain: types under the "typing" module are not hyperlinked defined
at info-field-list
* #9390: texinfo: Do not emit labels inside footnotes
* #9413: xml: Invalid XML was generated when cross referencing python objects
* #9979: Error level messages were displayed as warning messages
* #10057: Failed to scan documents if the project is placed onto the root
directory
Expand Down
3 changes: 3 additions & 0 deletions sphinx/builders/xml.py
Expand Up @@ -71,6 +71,9 @@ def write_doc(self, docname: str, doctree: Node) -> None:
# work around multiple string % tuple issues in docutils;
# replace tuples in attribute values with lists
doctree = doctree.deepcopy()
for domain in self.env.domains.values():
xmlns = "xmlns:" + domain.name
doctree[xmlns] = "https://www.sphinx-doc.org/" # type: ignore
for node in doctree.findall(nodes.Element):
for att, value in node.attributes.items():
if isinstance(value, tuple):
Expand Down

0 comments on commit 453e0c7

Please sign in to comment.