MCPcopy Create free account
hub / github.com/scanny/python-pptx / OxmlElement

Function OxmlElement

src/pptx/oxml/xmlchemy.py:35–43  ·  view source on GitHub ↗

Return a "loose" lxml element having the tag specified by `nsptag_str`. `nsptag_str` must contain the standard namespace prefix, e.g. 'a:tbl'. The resulting element is an instance of the custom element class for this tag name if one is defined.

(nsptag_str: str, nsmap: dict[str, str] | None = None)

Source from the content-addressed store, hash-verified

33
34
35def OxmlElement(nsptag_str: str, nsmap: dict[str, str] | None = None) -> BaseOxmlElement:
36 """Return a "loose" lxml element having the tag specified by `nsptag_str`.
37
38 `nsptag_str` must contain the standard namespace prefix, e.g. 'a:tbl'. The resulting element is
39 an instance of the custom element class for this tag name if one is defined.
40 """
41 nsptag = NamespacePrefixedTag(nsptag_str)
42 nsmap = nsmap if nsmap is not None else nsptag.nsmap
43 return oxml_parser.makeelement(nsptag.clark_name, nsmap=nsmap)
44
45
46def serialize_for_reading(element: ElementBase):

Callers 4

new_dPtMethod · 0.90
_new_extMethod · 0.90
_new_offMethod · 0.90
new_child_elementMethod · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…