MCPcopy Create free account
hub / github.com/BIT-DataLab/Edit-Banana / parse_drawio_xml

Function parse_drawio_xml

modules/utils/xml_utils.py:58–63  ·  view source on GitHub ↗

解析 DrawIO XML 文件或字符串,返回根元素

(path_or_string: str)

Source from the content-addressed store, hash-verified

56
57
58def parse_drawio_xml(path_or_string: str) -> ET.Element:
59 """解析 DrawIO XML 文件或字符串,返回根元素"""
60 if path_or_string.strip().startswith("<"):
61 return ET.fromstring(path_or_string)
62 tree = ET.parse(path_or_string)
63 return tree.getroot()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected