Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion reqif/parsers/spec_types/relation_group_type_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ def unparse(spec_relation_type: ReqIFRelationGroupType):
output += f' LAST-CHANGE="{spec_relation_type.last_change}"'
if spec_relation_type.long_name is not None:
output += f' LONG-NAME="{spec_relation_type.long_name}"'
if spec_relation_type.is_self_closed:
has_attributes = (
spec_relation_type.attribute_definitions is not None
and len(spec_relation_type.attribute_definitions) > 0
)
if spec_relation_type.is_self_closed and not has_attributes:
output += "/>\n"
return output

Expand Down
6 changes: 5 additions & 1 deletion reqif/parsers/spec_types/spec_relation_type_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ def unparse(spec_relation_type: ReqIFSpecRelationType):
output += f' LAST-CHANGE="{spec_relation_type.last_change}"'
if spec_relation_type.long_name is not None:
output += f' LONG-NAME="{spec_relation_type.long_name}"'
if spec_relation_type.is_self_closed:
has_attributes = (
spec_relation_type.attribute_definitions is not None
and len(spec_relation_type.attribute_definitions) > 0
)
if spec_relation_type.is_self_closed and not has_attributes:
output += "/>\n"
return output

Expand Down
5 changes: 4 additions & 1 deletion reqif/parsers/spec_types/specification_type_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def unparse(spec_type: ReqIFSpecificationType) -> str:
output += f' LONG-NAME="{spec_type.long_name}"'

# Some documents have a SPECIFICATION-TYPE without any SPEC-ATTRIBUTES.
if spec_type.is_self_closed:
has_attributes = (
spec_type.spec_attributes is not None and len(spec_type.spec_attributes) > 0
)
if spec_type.is_self_closed and not has_attributes:
output += "/>\n"
return output
else:
Expand Down
Loading