We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff4f37b commit c2e6d21Copy full SHA for c2e6d21
src/modelspec/base_types.py
@@ -170,7 +170,7 @@ def from_xml(cls, xml_str: str) -> "Base":
170
from modelspec.utils import element_to_dict
171
172
root = ET.fromstring(xml_str)
173
- data_dict = element_to_dict(root)
+ data_dict = {root.tag: element_to_dict(root)}
174
return cls.from_dict(data_dict)
175
176
def to_json_file(
@@ -383,7 +383,7 @@ def from_xml_file(cls, filename: str) -> "Base":
383
tree = ET.parse(filename)
384
root = tree.getroot()
385
386
387
388
389
def get_child(self, id: str, type_: str) -> Any:
0 commit comments