Serialize an object to XML. Args: obj: The object to serialize. ns_map: The namespace map to use. Returns: The XML as string.
(self, obj: object, ns_map: Optional[dict[Optional[str], str]] = None)
| 72 | return self.parser.from_bytes(xml, clazz) |
| 73 | |
| 74 | def serialize(self, obj: object, ns_map: Optional[dict[Optional[str], str]] = None) -> str: |
| 75 | """ |
| 76 | Serialize an object to XML. |
| 77 | |
| 78 | Args: |
| 79 | obj: The object to serialize. |
| 80 | ns_map: The namespace map to use. |
| 81 | |
| 82 | Returns: |
| 83 | The XML as string. |
| 84 | """ |
| 85 | ns_map = ns_map or self.parser.ns_map or {"xs": "http://www.w3.org/2001/XMLSchema"} |
| 86 | return self.serializer.render(obj, ns_map) |
no outgoing calls
no test coverage detected