You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: IS-EDITABLE="false" is lost when a document is read and written again
#86
I have verified that I am running the latest version of the reqifsharp
I have searched open and closed issues to ensure it has not already been reported
Description
AccessControlledElement.WriteXml and WriteXmlAsync write the IS-EDITABLE attribute only when IsEditable is true. An explicit IS-EDITABLE="false" in the source document is therefore dropped when the document is read and written again, and the receiving tool falls back to its own default.
This matters for round-trips (see also #44, which retains the namespaces of the root element) and for the planned editing feature of the ReqIF Viewer, which should respect and preserve the editability set by the source tool.
The same change was made in a fork in 2021 (FernCreek/reqifsharp, "Update AccessControlledElement.cs", adding an IsEditableSpecified flag), but never proposed upstream.
Proposal
Record whether IS-EDITABLE was present on read (for example a nullable bool? or an IsEditableSpecified flag) and write it whenever it was present or set explicitly, in both sync and async writers.
Acceptance criteria
A document with IS-EDITABLE="false" on a spec object, read and written again, still has IS-EDITABLE="false"; elements without the attribute still have none.
Steps to Reproduce
Take a ReqIF file with <SPEC-OBJECT IDENTIFIER="so-1" IS-EDITABLE="false" ...>.
var reqifs = new ReqIFDeserializer().Deserialize("in.reqif");
new ReqIFSerializer().Serialize(reqifs, "out.reqif");
out.reqif contains <SPEC-OBJECT IDENTIFIER="so-1" ...> without IS-EDITABLE.
Activity