MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / serialize

Method serialize

src/bcf/bcf/xml_parser.py:74–86  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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)

Callers 7

_save_xmlMethod · 0.45
_save_xmlMethod · 0.45
_save_visinfoMethod · 0.45
_save_xmlMethod · 0.45
_save_xmlMethod · 0.45
_save_visinfoMethod · 0.45
saveMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected