Add people.xml relationship to document.xml.rels if not already present.
(self, path)
| 970 | editor.append_to(root, override_xml) |
| 971 | |
| 972 | def _add_relationship_for_people(self, path): |
| 973 | """Add people.xml relationship to document.xml.rels if not already present.""" |
| 974 | editor = self["word/_rels/document.xml.rels"] |
| 975 | |
| 976 | if self._has_relationship(editor, "people.xml"): |
| 977 | return |
| 978 | |
| 979 | root = editor.dom.documentElement |
| 980 | root_tag = root.tagName # type: ignore |
| 981 | prefix = root_tag.split(":")[0] + ":" if ":" in root_tag else "" |
| 982 | next_rid = editor.get_next_rid() |
| 983 | |
| 984 | # Create the relationship entry |
| 985 | rel_xml = f'<{prefix}Relationship Id="{next_rid}" Type="http://schemas.microsoft.com/office/2011/relationships/people" Target="people.xml"/>' |
| 986 | editor.append_to(root, rel_xml) |
| 987 | |
| 988 | def _update_settings(self, path, track_revisions=False): |
| 989 | """Add RSID and optionally enable track revisions in settings.xml. |
no test coverage detected