File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -122,8 +122,8 @@ def to_xml(self) -> str:
122
122
"""
123
123
from modelspec .utils import build_xml_element
124
124
125
- root = ET .Element ("modelspec" )
126
- build_xml_element ( root , self . to_dict () )
125
+ # root = ET.Element("modelspec")
126
+ root = build_xml_element ( self )
127
127
128
128
xml_string = ET .tostring (
129
129
root , encoding = "utf-8" , xml_declaration = False , method = "xml"
@@ -273,12 +273,12 @@ def to_xml_file(
273
273
if filename is None :
274
274
filename = f"{ self .id } .xml"
275
275
276
- root = ET .Element (root_name )
276
+ # root = ET.Element(root_name)
277
277
278
- build_xml_element ( root , self . to_dict () )
278
+ root = build_xml_element ( self )
279
279
280
280
# Create an ElementTree object with the root element
281
- tree = ET .ElementTree (root )
281
+ # tree = ET.ElementTree(root)
282
282
283
283
# Generate the XML string
284
284
xml_str = ET .tostring (root , encoding = "utf-8" , method = "xml" ).decode ("utf-8" )
You can’t perform that action at this time.
0 commit comments