(self, name: str, serialized_value: Any, depth: int)
| 201 | self.xg.endDocument() |
| 202 | |
| 203 | def _export_xml_field(self, name: str, serialized_value: Any, depth: int) -> None: |
| 204 | self._beautify_indent(depth=depth) |
| 205 | self.xg.startElement(name, AttributesImpl({})) |
| 206 | if hasattr(serialized_value, "items"): |
| 207 | self._beautify_newline() |
| 208 | for subname, value in serialized_value.items(): |
| 209 | self._export_xml_field(subname, value, depth=depth + 1) |
| 210 | self._beautify_indent(depth=depth) |
| 211 | elif is_listlike(serialized_value): |
| 212 | self._beautify_newline() |
| 213 | for value in serialized_value: |
| 214 | self._export_xml_field("value", value, depth=depth + 1) |
| 215 | self._beautify_indent(depth=depth) |
| 216 | elif isinstance(serialized_value, str): |
| 217 | self.xg.characters(serialized_value) |
| 218 | else: |
| 219 | self.xg.characters(str(serialized_value)) |
| 220 | self.xg.endElement(name) |
| 221 | self._beautify_newline() |
| 222 | |
| 223 | |
| 224 | class CsvItemExporter(BaseItemExporter): |
no test coverage detected