Register an lxml custom element-class to use for `tag`. A instance of `cls` to be constructed when the oxml parser encounters an element with matching `tag`. `tag` is a string of the form `nspfx:tagroot`, e.g. `'w:document'`.
(tag: str, cls: Type["BaseOxmlElement"])
| 30 | |
| 31 | |
| 32 | def register_element_cls(tag: str, cls: Type["BaseOxmlElement"]): |
| 33 | """Register an lxml custom element-class to use for `tag`. |
| 34 | |
| 35 | A instance of `cls` to be constructed when the oxml parser encounters an element |
| 36 | with matching `tag`. `tag` is a string of the form `nspfx:tagroot`, e.g. |
| 37 | `'w:document'`. |
| 38 | """ |
| 39 | nspfx, tagroot = tag.split(":") |
| 40 | namespace = element_class_lookup.get_namespace(nsmap[nspfx]) |
| 41 | namespace[tagroot] = cls |
| 42 | |
| 43 | |
| 44 | def OxmlElement( |
no outgoing calls
searching dependent graphs…