(
self, raw_doc: FilePath | ReadBuffer[bytes] | ReadBuffer[str]
)
| 520 | ) |
| 521 | |
| 522 | def _parse_doc( |
| 523 | self, raw_doc: FilePath | ReadBuffer[bytes] | ReadBuffer[str] |
| 524 | ) -> Element: |
| 525 | from xml.etree.ElementTree import ( |
| 526 | XMLParser, |
| 527 | parse, |
| 528 | ) |
| 529 | |
| 530 | handle_data = get_data_from_filepath( |
| 531 | filepath_or_buffer=raw_doc, |
| 532 | encoding=self.encoding, |
| 533 | compression=self.compression, |
| 534 | storage_options=self.storage_options, |
| 535 | ) |
| 536 | |
| 537 | with handle_data as xml_data: |
| 538 | curr_parser = XMLParser(encoding=self.encoding) |
| 539 | document = parse(xml_data, parser=curr_parser) |
| 540 | |
| 541 | return document.getroot() |
| 542 | |
| 543 | |
| 544 | class _LxmlFrameParser(_XMLFrameParser): |
no test coverage detected