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

Function qn

src/docx/oxml/ns.py:100–109  ·  view source on GitHub ↗

Stands for "qualified name". This utility function converts a familiar namespace-prefixed tag name like "w:p" into a Clark-notation qualified tag name for lxml. For example, `qn("w:p")` returns "{http://schemas.openxmlformats.org/wordprocessingml/2006/main}p".

(tag: str)

Source from the content-addressed store, hash-verified

98
99
100def qn(tag: str) -> str:
101 """Stands for "qualified name".
102
103 This utility function converts a familiar namespace-prefixed tag name like "w:p"
104 into a Clark-notation qualified tag name for lxml. For example, `qn("w:p")` returns
105 "{http://schemas.openxmlformats.org/wordprocessingml/2006/main}p".
106 """
107 prefix, tagroot = tag.split(":")
108 uri = nsmap[prefix]
109 return "{%s}%s" % (uri, tagroot)

Callers 15

then_type_is_page_breakFunction · 0.90
_set_element_datetimeMethod · 0.90
newMethod · 0.90
iter_block_itemsMethod · 0.90
_clark_nameMethod · 0.90
get_child_elementMethod · 0.90
get_child_elementMethod · 0.90
first_child_found_inMethod · 0.90
remove_allMethod · 0.90

Calls

no outgoing calls

Tested by 9

first_fixtureMethod · 0.72
getter_fixtureMethod · 0.72
getter_fixtureMethod · 0.72
getter_fixtureMethod · 0.72
getter_fixtureMethod · 0.72
getter_fixtureMethod · 0.72
getter_fixtureMethod · 0.72