Skip to content

Commit 5178aa8

Browse files
made the build_element_element function more dynamic when handling default values that are not factory but string in nature
1 parent f1b9349 commit 5178aa8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modelspec/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def build_xml_element(data, parent=None):
259259
parent.append(child_element)
260260

261261
# Filters name space and schemaLoacation attributes, only allows non name space attributes to be added as attributes
262-
elif aattr.name not in ["xmlns", "xmlns_url", "xmlns_loc", "xmln_loc_2"]:
262+
elif not isinstance(aattr.default, str):
263263
attribute_name = aattr.name
264264
attribute_value = data.__getattribute__(aattr.name)
265265
parent.set(attribute_name, str(attribute_value))

0 commit comments

Comments
 (0)