diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2022-01-16 02:49:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-16 02:49:01 +0900 |
commit | 453e0c798e3630480ee53b4149249bc2271a2597 (patch) | |
tree | 160febce8ade7625963eb2c80525474fbe1056dc | |
parent | d82d37073920ce0e2940dccbd25f719cc92a3352 (diff) | |
parent | 76c9b3c6055964b20bc0b0f79f6e37914f620ebc (diff) | |
download | sphinx-git-453e0c798e3630480ee53b4149249bc2271a2597.tar.gz |
Merge pull request #10100 from tk0miya/9413_xml_namespace
Fix #9413: xml: Invalid XML was generated when cross referencing python objects
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | sphinx/builders/xml.py | 3 |
2 files changed, 4 insertions, 0 deletions
@@ -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 diff --git a/sphinx/builders/xml.py b/sphinx/builders/xml.py index fdef14259..c4e066089 100644 --- a/sphinx/builders/xml.py +++ b/sphinx/builders/xml.py @@ -71,6 +71,9 @@ class XMLBuilder(Builder): # 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): |