Skip to content

Commit

Permalink
Add xmlns:xsi at the root element for config serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanfish committed Mar 30, 2024
1 parent 46577c6 commit 0c57cd1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions NAPS2.Lib/Config/Model/ConfigStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,10 @@ public void SerializeTo(XDocument doc, string? customRootElementName)
}
var serializer = new UntypedXmlSerializer();
var rootElementName = customRootElementName ?? serializer.GetDefaultElementName(typeof(TConfig));
doc.Add(new XElement(rootElementName));
CopyNodeToXElement(_root, doc.Root!, serializer);
var root = new XElement(rootElementName);
doc.Add(root);
root.SetAttributeValue(XNamespace.Xmlns + "xsi", "http://www.w3.org/2001/XMLSchema-instance");
CopyNodeToXElement(_root, root, serializer);
}
}

Expand Down

0 comments on commit 0c57cd1

Please sign in to comment.