解析 DrawIO XML 文件或字符串,返回根元素
(path_or_string: str)
| 56 | |
| 57 | |
| 58 | def 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() |
nothing calls this directly
no outgoing calls
no test coverage detected