MCPcopy Index your code
hub / github.com/python-openxml/python-docx / _rel_ref_count

Method _rel_ref_count

src/docx/opc/part.py:243–247  ·  view source on GitHub ↗

Return the count of references in this part's XML to the relationship identified by `rId`.

(self, rId: str)

Source from the content-addressed store, hash-verified

241 return self
242
243 def _rel_ref_count(self, rId: str) -> int:
244 """Return the count of references in this part's XML to the relationship
245 identified by `rId`."""
246 rIds = cast("list[str]", self._element.xpath("//@r:id"))
247 return len([_rId for _rId in rIds if _rId == rId])

Callers

nothing calls this directly

Calls 1

xpathMethod · 0.80

Tested by

no test coverage detected