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)
| 33 | |
| 34 | |
| 35 | def 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 | |
| 46 | def serialize_for_reading(element: ElementBase): |
no test coverage detected
searching dependent graphs…