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

Function parse_xml

src/docx/oxml/parser.py:23–29  ·  view source on GitHub ↗

Root lxml element obtained by parsing XML character string `xml`. The custom parser is used, so custom element classes are produced for elements in `xml` that have them.

(xml: str | bytes)

Source from the content-addressed store, hash-verified

21
22
23def parse_xml(xml: str | bytes) -> "BaseOxmlElement":
24 """Root lxml element obtained by parsing XML character string `xml`.
25
26 The custom parser is used, so custom element classes are produced for elements in
27 `xml` that have them.
28 """
29 return cast("BaseOxmlElement", etree.fromstring(xml, oxml_parser))
30
31
32def register_element_cls(tag: str, cls: Type["BaseOxmlElement"]):

Callers 15

defaultMethod · 0.90
defaultMethod · 0.90
newMethod · 0.90
newMethod · 0.90
defaultMethod · 0.90
loadMethod · 0.90
newMethod · 0.90
add_commentMethod · 0.90
new_tblMethod · 0.90
newMethod · 0.90
newMethod · 0.90

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…