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

Function nsdecls

src/docx/oxml/ns.py:84–89  ·  view source on GitHub ↗

Namespace declaration including each namespace-prefix in `prefixes`. Handy for adding required namespace declarations to a tree root element.

(*prefixes: str)

Source from the content-addressed store, hash-verified

82
83
84def nsdecls(*prefixes: str) -> str:
85 """Namespace declaration including each namespace-prefix in `prefixes`.
86
87 Handy for adding required namespace declarations to a tree root element.
88 """
89 return " ".join(['xmlns:%s="%s"' % (pfx, nsmap[pfx]) for pfx in prefixes])
90
91
92def nspfxmap(*nspfxs: str) -> Dict[str, str]:

Callers 9

CT_CorePropertiesClass · 0.90
add_commentMethod · 0.90
_tbl_xmlMethod · 0.90
newMethod · 0.90
_inline_xmlMethod · 0.90
_pic_xmlMethod · 0.90
_new_colorMethod · 0.90
with_nsdeclsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…